Answer to Question #314184 in C++ for Mujeeb

Question #314184

Develop a program that uses structure to display the readings of a boiler process variables (temperature and pressure) on hourly and daily basis.

The output of the program should display the reading as shown below.

Boiler hourly reading:

Boiler readings for day: 25 and hour: 2

Pressure measurements: 25 Pascals

Temperature measurements: 40C


1
Expert's answer
2022-03-19T02:24:51-0400
using namespace std;


/*
	Develop a program that uses structure to display the readings of a boiler process variables (temperature and pressure) on hourly and daily basis.
	The output of the program should display the reading as shown below.
	Boiler hourly reading:
	Boiler readings for day: 25 and hour: 2
	Pressure measurements: 25 Pascals
	Temperature measurements: 40C
*/


#define NO_OF_READINGS	10


struct Boiler
{
	float Temp;
	float Pressure;	
};


int main()
{
	struct Boiler B[NO_OF_READINGS];
	int n;
	
	for(n=0;n<NO_OF_READINGS;n++)
	{
		B[n].Pressure = n*10;
		B[n].Temp     = n*5;
		cout<<"\t# "<<n+1<<"\tBoiler Pressure = "<<B[n].Pressure<<" KPa\tTemperature = "<<B[n].Temp<<" deg. C"endl;
	}
	return(0);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog