Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Write a C++ program to enter 24 readings of tempe
rature (each reading is between

5
and 45), compute and print out the average temperature, maximum temperature and
minimum temperature of the day. Enforce the necessary validation on the user input.
Use proper format for the output.
 one year ago
 one year ago
Write a C++ program to enter 24 readings of tempe rature (each reading is between  5 and 45), compute and print out the average temperature, maximum temperature and minimum temperature of the day. Enforce the necessary validation on the user input. Use proper format for the output.
 one year ago
 one year ago

This Question is Open

ShadowysBest ResponseYou've already chosen the best response.0
eh? do you have your current attempt? I see decalrations, functions, and while and if loops...
 one year ago

fatemahBest ResponseYou've already chosen the best response.0
so how is it solved ???
 one year ago

ShadowysBest ResponseYou've already chosen the best response.0
trying to write one now. lol i'm using asking user input to be put into arrays. though i would rather write in python. lol seems like it's working.
 one year ago

ShadowysBest ResponseYou've already chosen the best response.0
int main() { int a; int i=0; int temp[24]; while (i<2) { cin>>a; if (a<45) { temp[i]=a; i++; } else { cin.clear(); while (cin.get() != '\n') ; cin>>a; } } } this is the main function where iteration is used to place the values.
 one year ago

ShadowysBest ResponseYou've already chosen the best response.0
note that the array simply has 2 values. since i<2. edit this to include 24 values.
 one year ago

ShadowysBest ResponseYou've already chosen the best response.0
after putting them in an array, add them together with a while or for function before dividing them by their total number. for max, just write an auto update function that will update when there is a number that is larger than before.
 one year ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.