Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program to do the following tasks: Create a text file temperatures.txt , which contains the average temperatures in Celsius for the 5

Write a C program to do the following tasks:
Create a text file temperatures.txt, which contains the average temperatures in Celsius for the 5 winter months 11,12,1,2,3 for the 10 years 2010 till 2019 as follow:
The file ends with the sentinel (-1) representing the year.
Each line contains: year and 5 temperatures.
Let the program reads from the file temperatures.txt and computes the average temperatures for each year, and the highest and lowest temperatures.
Use a function calculate that receives year, 5 temperature values, and returns the average, highest, and lowest temperatures for the given 4 months that year.
Do the printing in the main function.
Display on screen (not on a file) the result as shown in the table below:
year
average highest
lowest
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_2

Step: 3

blur-text-image_3

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

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

How does cultural meaning influence the consumption process?

Answered: 1 week ago

Question

Explain how CSMA/CA PCF works.

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago