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

1 Expert Approved Answer
Step: 1 Unlock

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... View full answer

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 Programming Questions!