Question: Create the base Account class along with inherited Checking and Savings account according to diagram. The Account class withdraw method is implemented by doing nothing.

Create the base Account class along with inherited Checking and Savings account according to diagram. The Account class withdraw method is implemented by doing nothing. The CheckingAccount withdraw method must fulfill the policy that the withdraw amou nt must greater than 0 and less than or equal to current account balance. The SavingsAccount withdraw method must fulfill the policy that the minimum balance of the account must be 500 all the time. Also the withdraw amount must greater than 0. If the cond ition cannot be fulfilled, either withdraw method will do nothing but return. When addInterest method in SavingsAccount class, the account balance updated to current_balance * (1 + interestRate) where interestRate is in decimal form. For instance, 6% is 0.0 6
 Create the base Account class along with inherited Checking and Savings

Account -id: int -balance: double +Account() +Account(id: int, balance: double) +setBalance(balance:double):void +getBalanceO:double +setld(id:int):void +getldO:int +deposit(amount:doube): void +withdraw(amount:double):void +toString:Strin CheckingAccount +withdraw(amount:double):void +toStringQ:strin SavingAccount -interestRate: double +setlnterestRate(rate:double):void +getlnterestRate0:double +withdraw(amount:double):void addlnterest0:void +toString0:striin

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!