Assignment -
Write the class Banking that tests the transferTo method of Account class and print the results of accounts before and after transfer.
Program Plan:
- Create a class called Account.java
- Declare instance variables to store name, account number and initial balance.
- Write a method called transferTo that takes account number, amount to transfer and fee for transfer and then transfer the amount from this class to the Account class given to transferTo method.
- Create a test java class called Banking.
- Create two test Account classes from and to.
- Set name ,account number and balance of two account objects.
- Call the method transferTo method and print results of account objects before and after transferTo method.