C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 20, Problem 20.14E
Program Plan Intro

Program Plan:

  • Use the class hierarchy created in Exercise 19.10.
  • Add user interaction part by allowing users to input the amount being credited or debited.
  • Modify the information provisioning functionality by informing about the account balance after each interaction based on the account type.

Program Description:

We will have three classes Account, SavingsAccount and CheckingAccount with desired attributes and operations. We will re-use the class hierarchy created in Exercise 19.10 and make use of virtual functions for implementing credit and debit operations. Usage of virtual functions and overridden methods in the hierarchy will demonstrate dynamic polymorphism and reduce the code overhead significantly.

Blurred answer
Students have asked these similar questions
.“Dangling and wild pointers are known to be problems with pointers”. Justify the given statement with the helpof suitable example
Write in C++ Language.   (Employee Record): Create a class named 'Staff' having the following members: Data members - Id – Name - Phone number – Address - AgeIt also has a function named 'printSalary' which prints the salary of the staff.Two classes 'Employee' and 'Officer' inherits the 'Staff' class. The 'Employee' and 'Officer' classes have data members 'Top Skill' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a officer by making an object of both of these classes and print the same.
(Payroll System Modification) Modify the payroll system of Figs. 20.9–20.17 to includeprivate data member birthDate in class Employee. Use class Date from Figs. 18.6–18.7 to representan employee’s birthday. Assume that payroll is processed once per month. Create a vector of Employee references to store the various employee objects. In a loop, calculate the payroll for each Employee (polymorphically), and add a $100.00 bonus to the person’s payroll amount if the currentmonth is the month in which the Employee’s birthday occurs.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education