anonymous
  • anonymous
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.
Computer Science
katieb
  • katieb
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

anonymous
  • anonymous
eh? do you have your current attempt? I see decalrations, functions, and while and if loops...
anonymous
  • anonymous
so how is it solved ???
anonymous
  • anonymous
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.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
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.
anonymous
  • anonymous
note that the array simply has 2 values. since i<2. edit this to include 24 values.
anonymous
  • anonymous
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.

Looking for something else?

Not the answer you are looking for? Search for more explanations.