logo CodeStepByStep logo

temperatures

Language/Type: C arrays
Related Links:
Author: Allison Obourn (on 2020/09/14)

Write a console program that prompts the user for a number of days. Then prompt the user for that number of days worth of temperatures. Print out the average temperature and the number of days above average.

How many days' temperatures? 7
Day 1's high temp: 45
Day 2's high temp: 44
Day 3's high temp: 39
Day 4's high temp: 48
Day 5's high temp: 37
Day 6's high temp: 46
Day 7's high temp: 53
Average temp = 44.6
4 days were above average.
Complete program: Write an entire program that you could put into a file and run outside of CodeStepByStep.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.