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 $ cant withdraw more than three times in a month, and the monthly interest rate Account::getAnnualInterestRate
CheckingAccount needs to maintain a minimum balance of $ has no limitation on how many withdraws allowed in a month, and receives no interests, the monthly interest rate
Both SavingAccount and CheckingAccount cant withdraw money with insufficient balance:
you need to check if the savingAccount or checkingAccount has enough money before withdraw, if not, display a message to the console;
dont allow a savingAccount to withdraw more than three times in a month, and display a message to the console, and
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 $ and $ initial balance, and one CheckingAccount with $ initial balance. Withdraw $ from each account times
Sample UML:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
