ITEC 120 LAB 10 Back to Lab index page

A Bank Account Class

1) File Account.java contains a partial definition for a class representing a bank account. Save it to your directory and study it to see what methods it contains. Then complete the Account class as described below. Note that you won't be able to test your methods until you write ManageAccounts (the driver) in question #2.

2) File ManageAccounts.java contains a shell program that uses the Account class above. Save it to your directory, and complete it as indicated by the comments.

3) Modify ManageAccounts.java so that it prints the balance after the calls to chargeFees. Instead of using the getBalance method like you did after the deposit and withdrawal, use the balance that is returned from the chargeFees method. You can either store it in a variable and then print the value of the variable, or embed the method call in a println statement.