Question: This my code for the account.java it refers to and this is the test code for Accounts (above) Transfering Funds File Account.java (see A Flexible

 This my code for the account.java it refers to and this

This my code for the account.java it refers to

is the test code for Accounts (above) Transfering Funds File Account.java (seeA Flexible Account Class exercise) contains a definition for a simple bankaccount class with methods to withdraw, deposit, get the balance and account

and this is the test code for Accounts (above)

number, and print a summary. Save it to your directory and studyit to see how it works. Then write the following additional code:

Transfering Funds File Account.java (see A Flexible Account Class exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and print a summary. 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 acctl and acct2 are Account objects, then the call acctl.transferfacct2,957.80) should transfer $957.80 from acctl to acct2. Be sure to clearly document which way the transfer goes! 2. Write a class TransferTest with a main method that creates two bank account objects and enters a loop that does the following: Asks if the user would like to transfer from accountl to account2, transfer from account2 to accountl, or quit D If a transfer is chosen, asks the amount of the transfer, carries out the operation, and prints the new balance for each account. Repeats until the user asks to quit, then prints a summary for each account. 3. Add a static method to the Account class that lets the user transfer money between two accounts without going through either account. You can (and should) call the method transfer just like the other one -you are overloading this method. Your new method should take two Account objects and an amount and transfer the amount from the first account to the second account. The signature will look like this: public static void transfer(Account acctl, Account acct2, double amount) Modify your TransferTest class to use the static transfer instead of the instance version

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!