Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 25th European Conference Adbis 2021 Tartu Estonia August 24 26 2021 Proceedings Lncs 12843

Authors: Ladjel Bellatreche ,Marlon Dumas ,Panagiotis Karras ,Raimundas Matulevicius

1st Edition

3030824713, 978-3030824716

More Books

Students also viewed these Databases questions

Question

1. Explain the 2nd world war. 2. Who is the father of history?

Answered: 1 week ago

Question

1. Define mass and mediated communication

Answered: 1 week ago