Question: volumeValue and temperatureValue are read from input. Declare and assign pointer myGas with a new Gas object. Then, set myGas's volume and temperature to volumeValue

volumeValue and temperatureValue are read from input. Declare and assign pointer myGas with a new Gas object. Then, set myGas's volume and temperature to volumeValue and temperatureValue, respectively.

Ex: if the input is 47 12, then the output is:

Gas's volume: 47 Gas's temperature: 12

#include using namespace std;

class Gas { public: Gas(); void Print();

int volume; int temperature; }; Gas::Gas() { volume = 0; temperature = 0; } void Gas::Print() { cout << "Gas's volume: " << volume << endl; cout << "Gas's temperature: " << temperature << endl; }

int main() { int volumeValue; int temperatureValue; /* Additional variable declarations go here */ cin >> volumeValue; cin >> temperatureValue; /* Your code goes here */ myGas->Print(); return 0; }

c++ and please please make it correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!