public void payInterest() { for (BankProduct bp : bankProducts) { if (bp instanceof Deposit) { bp.setCurrentMoney(bp.getCurrentMoney() + (bp.getCurrentMoney() * bp.getYearlyInterest())); } } }
private double calculateMonthlyDepositAccumulations() { double total = 0; for (BankProduct d : bankProducts) { total += d.getMonthlyDepositAccumulation(); } return total; }
public double getAllDepositMoney() { for (BankProduct bp : bankProducts) { if (bp instanceof Deposit) { allDepositMoney += bp.getCurrentMoney(); } } return allDepositMoney; }