Home / Expert Answers / Computer Science / 1-derived-classes-of-account-in-week-9-lab-exercise-1-we-created-the-account-class-to-model-a-b-pa433

(Solved): 1. (Derived classes of Account) In Week 9 Lab Exercise 1, we created the Account class to model a b ...



student submitted image, transcription available below
1. (Derived classes of Account) In Week 9 Lab Exercise 1, we created the Account class to model a bank account. An account has the properties account number, balance, and annual interest rate, and functions to deposit and withdraw. Create two derived classes for checking and savings accounts. A checking account has an overdraft limit, but a savings account cannot be overdrawn. Also, a savings account has a maximum deposit limit. Define a constant virtual tostring () function in the Account class and override it in the derived classes to return the account number and balance as a string. - Draw the UML diagram for the classes - Implement the classes - Write a test program that creates objects of Account, SavingsAccount, and CheckingAccount with initial balances of each and annual interest rates of for the Account and CheckingAccount objects, and for the SavingsAccount object - Invoke their toString () functions at each withdrawal or deposit. Attempt to overdraw the checking account (give it an overdraft limit of f2000) and deposit above the limit for the savings account (give it a deposit limit of f1000) A sample run is shown here: Account 1432 has a balance of Checking account 1433 has a balance of Savings account 1434 has a balance of Withdrawing from account 1432 Account 1432 has a balance of Attempting to withdraw from checking account 1433 Checking account 1433 has a balance of Attempting to withdraw from checking account 1433 Failed: withdrawal will exceed overdraft limit of for this checking account Checking account 1433 has a balance of Depositing to account 1432 Account 1432 has a balance of Attempting to deposit to savings account 1434 Savings account 1434 has a balance of Attempting to deposit to savings account 1434 Failed: deposit will exceed limit of for this savings account Savings account 1434 has a balance of


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe