Help with arrays?
The Bank class will have an array of Accounts. It's constructor will instantiate
the array and will populate it with 5 Account objects. The account numbers
will be from 1 to 5, and the balances will all be $100. It will also have
a method called doTransactions, which will require an array of Transactions
as a parameter. This method will step through the array and process each
transaction by calling the appropriate method in the appropriate Account
object. If a doWithdrawal call returns a false, it will write to System.out
"Insufficient funds for a withdrawal of " and the amount that was attempted
to be withdrawn (properly formatted in dollars and cents, of course). In
any case, it will send to System.out the transaction's toString result and
the affected account's toString (the account toString AFTER the processing).
The Project5 class will instantiate a Bank object and an array of 10 Transaction
objects. It will populate the array with Transactions by randomly generating
an integer from 1 to 5 for the account number, randomly generating an integer
from 1 to 2 for the transaction type, and randomly generating a double from
1 to 200 for the amount, generating new values for each Transaction object.
It will then call the doTransactions method of the Bank object and end.
Part of the project asks for arrays and I still don't understand them. Any
help would be thanked.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center