Question
Develop a polymorphic banking app using the Account hierarchy. Create an array of Account references to Savings-Account and Checking Account objects. For each Account in
Develop a polymorphic banking app using the Account hierarchy. Create an array of Account references to Savings-Account and Checking Account objects. For each Account in the array, allow the user to specify an amount of money to withdraw from the Account using method Debit and an amount of money to deposit into the Account using method Credit. As you process each Account, determine its type. If an Account is a Savings-Account, calculate the amount of interest owed to the Account using method Calculate Interest, then add the interest to the account balance using method Credit. After processing an Account, display the updated account balance obtained by using base class property Balance.
Step by Step Solution
3.28 Rating (145 Votes )
There are 3 Steps involved in it
Step: 1
Accounth ifndef ACCOUNTH define ACCOUNTH class Account public Account double constructor initializes balance Write a function prototype for virtual function credit Write a function prototype for virtu...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started