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
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);
}
Comments
Leave a comment