Design and write 3 classes


Bank Accounts
Design and write 3 classes - Account, CheckingAccount, and SavingsAccount. Have CheckingAccount and SavingsAccount inherit from Account. In Account, you should include an account number, an account balance, a deposit and toString method, and an abstract withdraw method. Since deposits work the same way in both child classes, make sure they cannot override it. The constructor should only take an initial deposit and generate a random 5 digit account number. The toString should display the account number and the balance. Use a NumberFormat object to format the balance.

In the CheckingAccount class add a minimum balance and overdraft fee. Implement the withdraw method so that overdrafts are allowed, but the overdraft fee is incurred if the balance drops below the minimum balance. Override the toString method to display everything the Account toString displays plus the minimum balance. Use the parent class toString to do most of the work. You should not need a NumberFormat object in this method.

In the SavingsAccount class add an annual interest rate and a method to recalculate the balance every month. Since the interest rate is annual, make sure to calculate the interest accordingly. Override the toString method to display everything the Account toString displays plus the interest rate. Like the CheckingAccount toString, you should use the parent class to do most of the work and should not need a NumberFormat object. 

Create a driver class to instantiate and exercise each of the account types.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Design and write 3 classes
Reference No:- TGS0109791

Expected delivery within 24 Hours