QUESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , fuel.cpp , petrol.cpp , liquid.cpp . )

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
icon
Related questions
Question

QUESTION PROVIDED IN ATTACH IMAGE KINDLY SEE. AND BELOW TEMPLATES PROVIDED CHECK THIS BEFORE MAKING SOLUTION ( main.cpp , fuel.cpp , petrol.cpp , liquid.cpp . )

 

-------------------Templates Below----------------------

main.cpp template

#include <iostream>
#include <iomanip>
#include "Petrol.cpp"
using namespace std;
int main()
{

//fill your code here.

return 0;

}

 

fuel.cpp template

#include <iostream>
#include<stdio.h>
using namespace std;
class Fuel
{
//fill your code here
};

 

petrol.cpp template

#include <iostream>
#include <iomanip>
#include "Liquid.cpp"
#include "Fuel.cpp"
using namespace std;
class Petrol: public Liquid, public Fuel
{
//fill your code here.
};

 

liquid.cpp template

#include <iostream>
#include<stdio.h>
using namespace std;
class Liquid
{
//fill your code here
};

Write a C++ program to implement multiple inheritance concepts and calculate the heat of
combustion.
Strictly adhere to the Object-Oriented specifncations given in the problem statement. All class
names, member variable names, and function names should be the same as specified in the
problem statement.
Problem Constraint:
Heat of combustion (9.-12400-2.100
Where Q, is measured in calories per gram and dis the specific gravity at 60 "F (16 "C)
The class Liquid has the following private data members.
Data Type
hoat
Variable Name
kpecifeGravity
Include necessary constructors, petters, and setters
In the Liquid class include the following member function.
Function name Description
Mold display This function is used to display the specitc gravity
The class Fuel has the following private data members.
Data Type
loat
Variable Name
rate
Include necessary constructors petters, and setters
In the Fuel class, include the following member function.
Function name Description
Vold display This function is used to display the fuel rate per litre
The class Petrol derived from Lievid class and Fuel class has the following private data members.
Data Type
loat
string
Variable Name
heatCombustion
type
Include necessary constructors, petters, and setters
In the Petrol class, Include the following member function
Function name
Description
This function is used to calculate the heat of combustion using the following formula
Heat of combustion(QJ-12.400-2.100s.
This function is used to display the heat of combustion value and to call the display function
in the base class Liquid and fuel. Display heat of combustion value with respect to two decimal places.
Vold calculateHeatCombustion
vold displayo
In the main method, get the specific pravity, fuel rate per titre, and petrol type from the user.
Create an object for the derived class and call the derived class display method.
Input and Output format:
Refer sample input and output for formatting speciications.
(AH Texts in bold corresponds to the input and the remaining corresponds to the output)
Sample Input and Output:
Enter the specific gravity
0.7
Enter fuel rate per litre:
0.99
Petrol type
Premium
Fuel Detals:
Specinic gravity:0.7
Fuel rate per liter:0.99
Heat of combustion(Q1137100
Transcribed Image Text:Write a C++ program to implement multiple inheritance concepts and calculate the heat of combustion. Strictly adhere to the Object-Oriented specifncations given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. Problem Constraint: Heat of combustion (9.-12400-2.100 Where Q, is measured in calories per gram and dis the specific gravity at 60 "F (16 "C) The class Liquid has the following private data members. Data Type hoat Variable Name kpecifeGravity Include necessary constructors, petters, and setters In the Liquid class include the following member function. Function name Description Mold display This function is used to display the specitc gravity The class Fuel has the following private data members. Data Type loat Variable Name rate Include necessary constructors petters, and setters In the Fuel class, include the following member function. Function name Description Vold display This function is used to display the fuel rate per litre The class Petrol derived from Lievid class and Fuel class has the following private data members. Data Type loat string Variable Name heatCombustion type Include necessary constructors, petters, and setters In the Petrol class, Include the following member function Function name Description This function is used to calculate the heat of combustion using the following formula Heat of combustion(QJ-12.400-2.100s. This function is used to display the heat of combustion value and to call the display function in the base class Liquid and fuel. Display heat of combustion value with respect to two decimal places. Vold calculateHeatCombustion vold displayo In the main method, get the specific pravity, fuel rate per titre, and petrol type from the user. Create an object for the derived class and call the derived class display method. Input and Output format: Refer sample input and output for formatting speciications. (AH Texts in bold corresponds to the input and the remaining corresponds to the output) Sample Input and Output: Enter the specific gravity 0.7 Enter fuel rate per litre: 0.99 Petrol type Premium Fuel Detals: Specinic gravity:0.7 Fuel rate per liter:0.99 Heat of combustion(Q1137100
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Database connectivity
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr