Question: Write a program that does the following in C. 1. Reads 10 temperatures from the console (standard input). Each value represents the high temp for

Write a program that does the following in C.

1. Reads 10 temperatures from the console (standard input). Each value represents the high temp for a given day in a 10-day period.

2. Stores the temperatures in an array. You must use the same array for all the temperatures.

3. Finds and displays the highest recorded temperature.

4. Finds and displays the day when the highest temperature was recorded. If two or more days tie for the highest temperature, the program will report all the days with the highest temperature.

Hint: To save time, create a text file with test data and use input redirection when testing your code.

Sample:

You will be asked to enter the daily high temperature for 10 consecutive days. Enter a high temperature: 91 Enter a high temperature: 93 Enter a high temperature: 92 Enter a high temperature: 97 Enter a high temperature: 90 Enter a high temperature: 88 Enter a high temperature: 95 Enter a high temperature: 97 Enter a high temperature: 96 Enter a high temperature: 96

The highest recorded temperature in the 10-day period was: 97 degrees Recorded on the following days: Day 4 Day 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!