import java.util.*; import TransactionCollection; class Account { TransactionCollection transactions; double balance; String name; String owner; double interestRate; public Account() { balance = 0; name = ""; owner = ""; interestRate = 0; transactions = new TransactionCollection(); } public void reCalcBalance() { double currBal = balance; int index; Transaction temp; for(index = 0; index < transactions.tCollection.size(); index++) { temp = (Transaction)transactions.tCollection.elementAt(index); temp.balance = currBal; currBal += temp.amount; } } public Account(double b, String n, String o, double ir) { balance = b; name = n; owner = o; interestRate = ir; transactions = new TransactionCollection(); } public void compoundInterest() { balance += balance * interestRate; } public String toString() { return(owner + " " + " " + name + " " + " " + interestRate + " " + " " + balance); } }