Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Question 1(5 Marks) (Polymorphic Banking Program Using Account Hierarchy)
- Develop a polymorphic banking program using the Account created in Lab No 2. Create
- a vector of Account pointers to SavingAccount and CheckingAccount objects. For each
- Account in the vector, allow the user to specify an amount of money to withdraw from
- the Account using member function debit and an amount of money to deposit member
- function credit. As you process each Account, determine its type. If an Account is a
- SavingAccount, calculate the amount of interest owed to the Account using member
- function calculateInterest, then add the interest to account balance using member function
- credit. After processing an Account, print the updated account balance obtained by
- invoking base-class member function getBalance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement