Question: Chapter 3 : Input / Output Problem 3 Temperature Write a C + + program that reads daily temperature data for a month and calculates

Chapter 3: Input/Output
Problem 3 Temperature
Write a C++ program that reads daily temperature data for a month and calculates the average temperature for each day and the overall temperature of the month. The program should read the data for the entire month from a file named temperatures.txt (given). Assume the month has 30 days. The input file contains one line for each day, where each line has 4 temperature readings (in degrees Celsius) for that day, separated by spaces. Adjust decimal placed as per the below sample output.
temeratures.txt content:
\table[[23.5,25.1,22.8,24.0],[24.5,26.2,25.5,27.1],[22.3,23.7,24.1,26.0],[21.5,22.0,20.8,20.6],[25.2,24.9,24.5,21.4],[23.1,22.8,22.5,22.7],[27.0,26.5,28.1,27.8],[20.3,19.8,21.2,25.3],[22.2,21.9,22.5,23.0],[24.6,23.7,25.1,24.8]]
Sample output:
 Chapter 3: Input/Output Problem 3 Temperature Write a C++ program that

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!