Write a program that will input temperatures for consecutive days. The program w
ID: 3634185 • Letter: W
Question
Write a program that will input temperatures for consecutive days. The program will store these values into an array and call a function that will return the average of the temperatures. It will also call a function that will return the highest temperature and a function that will return the lowest temperature. The user will input the number of temperatures to be read. There will be no more than 50 temperatures. Use typedef to declare the array type. The average should be displayed to two decimal places.Sample Run:
Please input the number of temperatures to be read
5
Input temperature 1:
68
Input temperature 2:
75
Input temperature 3:
36
Input temperature 4:
91
Input temperature 5:
84
The average temperature is 70.80
The highest temperature is 91.00
The lowest temperature is 36.00
Explanation / Answer
you may also dowload the code from http://www.2shared.com/file/d8m-cqja/TEMP.html #include#include typedef int Temperature[50]; float getAvg(const Temperature,int); int getHigh(const Temperature,int); int getLow(const Temperature,int); void main() { int times; float avgValue; int highestValue; int lowestValue; Temperature temp; couttimes; for(int i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.