Write a program that will read daily temperature reading for the month of January 2012. Your program should contain the following functions:
(a) main() function contains instructions of reading input needed and print all the related information.
(b) NORMAL() function calculates the number of normal days (temperature between 60F and 84F)
(c) AVERAGE() function calculates the average temperature in January 2012.
(d) DAYS() function calculates
1
Expert's answer
2012-03-13T07:41:04-0400
Dear customer, please state definitely what does DAYS() function calculate.
#include <iostream> using namespace std;
int i; int temperature[32];
int NORMAL(){ int res=0; for (i=1;i<=31;i++){ & if ((temperature[i]>=60) && (temperature[i]<=84)) res++; } return res; }
float AVERAGE(){ float res=0; for (i=1;i<=31;i++) & res = res+temperature[i]; return (res/31); }
void main(){ for (i=1;i<=31;i++){ & cout<<"Enter a day temperature on January "<<i<<": "; & cin>>temperature[i]; } cout<<"The number of normal days is "<<NORMAL()<<"\n"; cout<<"The average temperature is "<<AVERAGE()<<"\n"; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment