Question: Question 1 : Temperature Data Analysis Problem Statement: Write a C + + program that records and analyzes daily temperature data for a week. The

Question 1: Temperature Data Analysis
Problem Statement: Write a C++ program that records and analyzes daily temperature
data for a week. The program should allow the user to input temperatures, and then
perform various operations such as calculating the average temperature, finding the
highest and lowest temperatures
Requirements:
Input Temperatures:
Use a single-dimension array to store the temperatures for 7 days.
Each temperature should be a floating-point number representing the
temperature in degrees Fahrenheit.
Function Definitions:
double calculateAverageTemperature(const double temperatures[], int size):
Calculate and return the average temperature for the week.
double findHighestTemperature(const double temperatures[], int size): Find
and return the highest temperature of the week.
double findLowestTemperature(const double temperatures[], int size): Find
and return the lowest temperature of the week.
Main Program:
The program should allow the user to input the temperature for each day of
the week.
After inputting the temperatures, the program should use the above
functions to:
Calculate and display the average temperature for the week.
Find and display the highest temperature recorded during the week.
Find and display the lowest temperature recorded during the week.
Example Output:
Enter the temperature for day 1:72.5
Enter the temperature for day 2: 75.0
Enter the temperature for day 3: 68.4
Enter the temperature for day 4:70.0
Enter the temperature for day 5:73.2
Enter the temperature for day 6:71.5
Enter the temperature for day 7:69.8
Average temperature: 71.77
Highest temperature: 75.0
Lowest temperature: 68.4
Question 1 : Temperature Data Analysis Problem

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 Programming Questions!