Question: Java Programming #21 --- Consider a banking system with 3 classes:BankAccount,CheckingAccount, andSavingsAccount, that you are to design and write. HaveCheckingAccountandSavingsAccountinherit fromBankAccount. InBankAccount, you should include

Java Programming #21

---

Consider a banking system with 3 classes:BankAccount,CheckingAccount, andSavingsAccount, that you are to design and write. HaveCheckingAccountandSavingsAccountinherit fromBankAccount. InBankAccount, you should include an account number, an account balance, a deposit method, atoStringmethod, and an abstractwithdrawmethod. 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. ThetoStringshould display the account number and the balance.

In theCheckingAccountclass add a minimum balance and a standard overdraft fee of $25. Implement thewithdrawmethod so that overdrafts are allowed, but the overdraft fee is incurred if the balance drops below the minimum balance. Override thetoStringmethod to display everything theBankAccount toStringdisplays plus the minimum balance. Use the parent classtoStringto do most of the work.

In theSavingsAccountclass add an annual interest rate (with a default value of 1.5%) and a method to recalculate the balance every month. Since the interest rate is annual, make sure to calculate the interest accordingly. Override thetoStringmethod to display everything theBankAccount toStringdisplays plus the interest rate. Like theCheckingAccount toString, you should use the parent class to do most of the work.

---

Code the Java implementation of theBankAccount. Note, no driver is required.

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 Programming Questions!