Write a C++ program that implements the following class hierarchy. Bill Elecuicity Bill where there exists a relation of inheritance between Bill and Electricity Bill. Class Bill should have following...


Write a C++ program that implements the following class hierarchy.<br>Bill<br>Elecuicity Bill<br>where there exists a relation of inheritance between Bill and Electricity Bill.<br>Class Bill should have following members<br>Data member<br>Bateceose.Oum<br>/for reference number<br>Member functions<br>//to take input of the data members; should be virtual<br>Input ()<br>//to display data members of its respective; should be virtual<br>Display ()<br>Class Elestricity.Bil should have following members<br>Data members<br>/for units<br>//for per unit price<br>//for tax<br>Units<br>Tax<br>Member functions<br>//to calculate total amount to be paid after deducting tax amount<br>//to take input of the data members of its respective and former class in the hierarchy /I;<br>should be virtual<br>Input()<br>//to display data members of its respective and former class in the<br>//hierarchy. This function will call Tatalanswoti) and also display the Total amount of //bill.; should be<br>virtual<br>Displayl)<br>Total amount of Bill is calculated as<br>(PatHnit.Riss Units) - Tax<br>

Extracted text: Write a C++ program that implements the following class hierarchy. Bill Elecuicity Bill where there exists a relation of inheritance between Bill and Electricity Bill. Class Bill should have following members Data member Bateceose.Oum /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 Elestricity.Bil should have following members Data members /for units //for per unit price //for tax Units 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 /I; should be virtual Input() //to display data members of its respective and former class in the //hierarchy. This function will call Tatalanswoti) and also display the Total amount of //bill.; should be virtual Displayl) Total amount of Bill is calculated as (PatHnit.Riss Units) - Tax
You are required to call the display function and hence display the Electricity Bill information<br>polymorphically (through base class object). The information to be displayed by the display function of<br>Electricity Bill includes reference number, units, per unit price, tax and total bill amount to be paid.<br>Output<br>Please enter reference number 346<br>Please enter units consumed 20<br>Please enter per unit price 2<br>Please enter tax amount<br>10<br>Reference number<br>346<br>Units<br>20<br>Таx<br>10<br>Per unit price<br>Amount to be paid<br>2<br>30<br>

Extracted text: You are required to call the display function and hence display the Electricity Bill information polymorphically (through base class object). The information to be displayed by the display function of Electricity Bill includes reference number, units, per unit price, tax and total bill amount to be paid. Output Please enter reference number 346 Please enter units consumed 20 Please enter per unit price 2 Please enter tax amount 10 Reference number 346 Units 20 Таx 10 Per unit price Amount to be paid 2 30
Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here