Question: Modify the Account class from the previous assignments: Add two subclasses, SavingAccount and CheckingAccount, inherited from the abstract base Account class. SavingAccount needs to maintain

Modify the Account class from the previous assignments:
Add two subclasses, SavingAccount and CheckingAccount, inherited from the abstract base Account class.
SavingAccount needs to maintain a minimum balance of $300, cant withdraw more than three times in a month, and the monthly interest rate = Account::getAnnualInterestRate()/12
CheckingAccount needs to maintain a minimum balance of $0, has no limitation on how many withdraws allowed in a month, and receives no interests, the monthly interest rate =0.
Both SavingAccount and CheckingAccount cant withdraw money with insufficient balance:
1. you need to check if the savingAccount or checkingAccount has enough money before withdraw, if not, display a message to the console;
2. dont allow a savingAccount to withdraw more than three times in a month, and display a message to the console, and
3. Display the account ID and account balance after the withdraw complete.
In Account class, make both constructor and setBalance() methods protected instead of public. Add the abstract keyword to Account class to make it become an abstract class
In SavingAccount, what instance and static variables you need to declare? What instance and static methods you need to override or implement?
(refer to the UML diagram)
In CheckingAccount, what instance and static variables you need to declare? What instance and static methods you need to override or implement?
(refer to the UML diagram)
Write a driver program to create an Account ArrayList to contain two SavingAccount objects with $2000 and $800 initial balance, and one CheckingAccount with $1000 initial balance. Withdraw $300 from each account 5 times
Sample UML:
 Modify the Account class from the previous assignments: Add two subclasses,

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!