Create these 2 classes:
BankAcct, and TestBankRunner
All money amounts are in cents to avoid decimal errors. So $1 = 100
Create a BankAcct class.
- Complete these methods:
- The constructor sets the account number and balance
- Accessors: getBalance and getAcctNo return whole numbers
- Accessor toString returns a string saying "Acct number XXXX has a balance of $XX.XX" converting the cents into dollars and cents for display.
- Mutators: deposit and withdraw
Create TestBankRunner that does the following:
- Test:
- Create 3 BankAcct accounts and number them 1111, 2222 and 3333
- Add the BankAccts to an ArrayList of <BankAcct>
- Deposit $10 to the first account, $20 to the second account and $30 to the third account
- Print out all the account balances and account numbers in table form using getBalance and getAcctNo
- Transfer $5 from account 1 to account 2
- Transfer $10 from account 2 to account 3
- Print out all the account balances and account numbers using the toString method