Question

In: Computer Science

C++ prgram: The heating system in a school should be switched on if the average temperature...

C++ prgram:

The heating system in a school should be switched on if the average temperature is less than 17 degrees Celsius. The average temperature is found from the temperatures in the Art, English and Music departments. You are required to write a program that allows the user to input 3 temperatures. The program calculates and displays the average temperature and then displays "heating should be on " or " heating should be off" as appropriate.

draw a flowchart for the solution

Solutions

Expert Solution

C ++

#include <iostream>

using namespace std;

int main()
{
//varaibales declaration
int num1,num2,num3;
float temp = 0;
//prints the statement
cout<<"Enter Art Temperature: ";
//reads the input
cin>>num1;
cout<<"Enter English Temperature: ";
//reads the input
cin>>num2;
cout<<"Enter Music Departments Temperature: ";
//reads the input
cin>>num3;
//calculates the average
temp = num1+num2+num3/3;
//checks the conditon if average is less than 17 if block is executed
if(temp<17)
{
//prints the statement
cout<<"heating should be on";
  
}
//when if block fails else block is executed
else
{
//prints the statement
cout<<"heating should be off";
  
}
return 0;
}

OUTPUT

FLOW CHART

THUMBS UP


Related Solutions

A heating system is designed to keep the inner wall surface temperature of a room at...
A heating system is designed to keep the inner wall surface temperature of a room at 25C. Only one wall of the room is contacted with the outer environment. The crosssectional view of the wall is schematically shown in Fig. H1. The height, width and thickness of the wall are 2.5 m, 10 m and 0.2 m, respectively. The wall is made from red bricks with a thermal conductivity of 0.72 W/m.K and solar absorptivity of s = 0.63. The...
The sample data below shows the average temperature (x, in degrees Fahrenheit) and monthly heating bill...
The sample data below shows the average temperature (x, in degrees Fahrenheit) and monthly heating bill (y, in dollars) for 12 recent months. Use Excel to compute the correlation coefficient. Enter your answer as a decimal rounded to three places. Correlation coefficient = Average temperature Monthly heating bill 29 326 36 295 42 241 58 196 62 154 70 93 74 33 77 0 68 62 57 184 45 263 33 302
At the surface of Venus the average temperature is a balmy 460∘C due to the greenhouse...
At the surface of Venus the average temperature is a balmy 460∘C due to the greenhouse effect (global warming!), the pressure is 92 Earth-atmospheres, and the acceleration due to gravity is 0.894 gEarth. The atmosphere is nearly all CO2 (molar mass 44.0g/mol) and the temperature remains remarkably constant. We shall assume that the temperature does not change at all with altitude. a. What is the atmospheric pressure 5.00 km above the surface of Venus? Express the answer in Earth--atmospheres. b....
A water has a temperature of 10o C and pH = 8. What should be the...
A water has a temperature of 10o C and pH = 8. What should be the C.t value for 3-log Giardia removal using (a) chlorine, (b) chloramine. Assume a chlorine residual of 1.0 mg/L is required. If the chlorine dosage required to achieve this residual is 1.6 mg/L, what is the chlorine requirement in lbs/d for a 2 mgd water plant.
Tempered glass is made by heating glass to a temperature to 620 ºC, then cooling it...
Tempered glass is made by heating glass to a temperature to 620 ºC, then cooling it quickly by spraying the surface in a procedure known as quenching. Quenching cools the outer surfaces more quickly than the center. As the center cools, it tries to pull back from the outer surfaces, which results in tension of the center and compression of the surfaces, which gives tempered glass its strength. The specific heat capacity of glass is 0.84 J/g ºC. A 23.6...
Draw a hybrid solar water heating system.
Draw a hybrid solar water heating system.
Sun Systems Ltd. is considering installing a new heating system in its factory to provide heating...
Sun Systems Ltd. is considering installing a new heating system in its factory to provide heating and power. Details are as follows: The existing heating system will cost £8,000 to remove, and has no value. If retained, the existing heating system has an expected life of a further 5 years. The new heating system will cost £57,000 including installation expenses of £2,800. The current heating system costs £22,000 per year in energy, £8,000 per year in maintenance and £2,000 per...
the average january temperature for helsinki,finald is 21.0 F and the average july temperature is 62.2...
the average january temperature for helsinki,finald is 21.0 F and the average july temperature is 62.2 F. how much hotter is it in july (Tjul-Tjan) in the rankine scale? what is the difference between july and january temperatures in the celsius scale? what is the difference between july and januare in the kelvin scale?
The following applications such as a home burglar system, combined household heating and cooling system, and...
The following applications such as a home burglar system, combined household heating and cooling system, and hospital recovery room are essential to our daily lives. Please Answer the following three questions. What are the physical quantities that need to be measured for each application and why they are important? Discuss any limitations and trade-offs that are involved in each application. Lastly, Identify the sensor category and sensor technology that could be used. Be sure to explain your reasoning.
Venus has an average temperature of 460? C. What fraction of CO2 molecules are moving faster...
Venus has an average temperature of 460? C. What fraction of CO2 molecules are moving faster than 750 m/s? What percentage of the molecules are moving faster than the escape velocity of 10.4 km/s? (This will be a very small percentage...) (b) Answer both of these questions for H2.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT