Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

fatemah

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
  1. Shadowys
    Best Response
    You've already chosen the best response.
    Medals 0

    eh? do you have your current attempt? I see decalrations, functions, and while and if loops...

    • one year ago
  2. fatemah
    Best Response
    You've already chosen the best response.
    Medals 0

    so how is it solved ???

    • one year ago
  3. Shadowys
    Best Response
    You've already chosen the best response.
    Medals 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
  4. Shadowys
    Best Response
    You've already chosen the best response.
    Medals 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
  5. Shadowys
    Best Response
    You've already chosen the best response.
    Medals 0

    note that the array simply has 2 values. since i<2. edit this to include 24 values.

    • one year ago
  6. Shadowys
    Best Response
    You've already chosen the best response.
    Medals 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
    • Attachments:

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
  • 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.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.