Transferring Money

File Account.java contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and print a summary. (This is very much like lab 1.) Save it to your directory and study it to see how it works. Then write the following additional code:

  1. Add a method public void transfer(Account acct, double amount) to the Account class that allows the user to transfer funds from one bank account to another. If acct1 and acct2 are Account objects, then the call acct1.transfer(acct2,957.80) should transfer $957.80 from acct1 to acct2.
  2. Write a class TransferTest with a main method that creates two bank account objects and enters a loop that does the following:

Go back to lab2 index page