Question: Write a C program that gets the temperature readings recorded six times a day for a week from the user. The program will display a
Write a C program that gets the temperature readings recorded six times a day for a week from the user. The program will display a table showing all the temperatures, the average of readings taken at the same time each day, the high and low temperature for each day, and the maximum and minimum temperature for the period including the day and time the maximum and minimum were recorded.
Store the input temperatures in an array defined as follows with READINGS #defined to have the value 6 and DAYS #defined to have the value 7.
double tempArray[READINGS][DAYS];
Break your program down into meaningful functions. I want to practice passing arrays to functions. In addition to main, you must have the following functions: A function called getTempReadings that gets the temperatures recorded for each day of the week and stores them in the double array that is its first argument. The second argument is the number of readings taken for each day which is also the number of elements in the first dimension of the input array. The prototype for this function is: void getTempReadings(double arrayOfTemps[][DAYS], size_t numReadings);
Sample Output 2:
The sorted array: $ - / 0 1 2 3 4 5 7 8 9 9 A a b B C C C D e e e G i j k M M m N o P q r r R r s t T t u U w X y Z ^ The sorted array after duplicate removal: $ - / 0 1 2 3 4 5 7 8 9 A b C D e G i j k M N o P q r s t u w X y Z ^ The input array: 9 5 A G r a P b r M R e q w e r t y u i 1 2 3 4 Z X C B N M 7 8 9 0 / ^ j k $ - U T D C o m e t s C Page 4 of 6
A function called findAvgReading that finds and returns the mean of a one-dimensional array of doubles. The array of doubles is its first argument and the number of elements in the array is its second argument. The prototype for this function is: double findAvgReading(const double tempReadings[], size_t numDays);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
