Question: C Programming.Use Code :: Blocks to write a program for this exercise: Global warming. As part of a global warming analysis, a research facility tracks
C Programming.Use Code :: Blocks to write a program for this exercise:
Global warming.
As part of a global warming analysis, a research facility tracks outdoor temperatures at the North Pole once a day, at noon, for a year. At the end of each month, these temperatures are entered into thecomputer and processed. The operator will enter 28, 29, 30, or 31 data items, depending on the month. You may use -500 as a sentinel value after the last temperature, since that is lower than absolute 0. Your main program should call the read_temps(), hot_days(), and print_temps() functions described here:
(a) Write a function, read_temps(), that has one parameter, an array called temps, in which to store the temperatures. Read the real data values for one month and store them into the slots of an array. Return the actual number of temperatures read as the result of the function.
(b) Write a function, hot_days(), that has two parameters: the number of temperatures for the current month and an array in which the temperatures are stored. Search through the temperature array and count all the days on which the noon temperature exceeds 32 Degree Fahrenheit. Return this count.
(c) Write a function, print_temps(), with the same two parameters plus the count of hot days. Print a neat table of temperatures. At the same time, calculate the average temperature for the month and print it at the end of the table, followed by the number of hot days.
SAMPLE INPUT: 85 23 -15 32 75 44 34 56 -1 0 23 23 34 -45 45 45 76 64 -32 0 23 23 34 -45 45 45 76 64 -32 76 -500 (NOT in computation)
SAMPLE OUTPUT:
Program#6 CSCI1110
Input Temperatures ------------------ -9999 ...
Average Temp: -99.99 Number of Temps: 99 Number above 32: 99
----PARTIAL SAMPLE OUTPUT Number above 32: 16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
