Write a C++ program that implements the following class hierarchy. Bill Electicity Bill Where there exists a relation of inheritance between Bill and Electricity Bill. Class Bill should have following members Data member I/for reference number Member functions //to take input of the data members; should be virtual Input () /to display data members of its respective; should be virtual Display () Class Elestcisity.Bill should have following members Data members Units //for units /for per unit price //for tax Тах Member functions /to calculate total amount to be paid after deducting tax amount /to take input of the data members of its respective and former class in the hierarchy //; should be virtual Inputi) //to display data members of its respective and former class in the //hierarchy. This function will call Totalamswoti) and also display the Total amount of I/bill; should be virtual Displayl) Total amount of Bill is calculated as (PatHais.Rrise*Units) - Tax
Write a C++ program that implements the following class hierarchy. Bill Electicity Bill Where there exists a relation of inheritance between Bill and Electricity Bill. Class Bill should have following members Data member I/for reference number Member functions //to take input of the data members; should be virtual Input () /to display data members of its respective; should be virtual Display () Class Elestcisity.Bill should have following members Data members Units //for units /for per unit price //for tax Тах Member functions /to calculate total amount to be paid after deducting tax amount /to take input of the data members of its respective and former class in the hierarchy //; should be virtual Inputi) //to display data members of its respective and former class in the //hierarchy. This function will call Totalamswoti) and also display the Total amount of I/bill; should be virtual Displayl) Total amount of Bill is calculated as (PatHais.Rrise*Units) - Tax
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 6E
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage