Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ENGR 200 SPRING 2017 P8: TEMPERATURE ANALYSIS (input/output files, if structures, for loops, two-dimensional array, one-dimensional character array) DUE: April 4, 2017 by 11:59 p.m.

ENGR 200 SPRING 2017

P8: TEMPERATURE ANALYSIS

(input/output files, if structures, for loops, two-dimensional array, one-dimensional character array)

DUE: April 4, 2017 by 11:59 p.m. CT (Extra Credit)

April 6, 2017 by 11:59 p.m. CT (final deadline) POINTS: 70

INTRODUCTION:

You are working on development of a new power plant for Centerville, USA. Average monthly temperature data has been collected as part of designing the new power plant, and you are required to develop a computer program that will perform averaging analysis. The input data file is called temp. As you examine the input file, you notice that the first record line is the name of the city and type of data, the second record line contains the control numbers, and the remaining record lines are the average monthly temperatures: 12 rows (January December) and 5 years (2012 2016).

ASSIGNMENT:

Write a C program that will read the data from the input file, such that the city name and type of data are stored in a one-dimensional character array, and the temperatures are store in a two-dimensional array. Manipulate the two-dimensional array to calculate the average temperature for each year and the standard deviation in temperature for each year. Then find the minimum and maximum temperatures and the locations in the array of the minimum and maximum values.

The formula for standard deviation is:

s= (((x-x )^2 ) / (n-1))

where s is the standard deviation, x is the individual sample values, x is the mean value, is the summation, and n-1 is the number of values in the sample minus 1. In this case, n is 12 (number of months in the year) and x is the yearly average temperature.

Print the output to the computer screen and to an output file called temp_report. Illustrated below is the output style for the computer screen and the output file.

OUTPUT FORMAT:

*****************************************************

Centerville-Temperature

Year 1 Year 2 Year 3 Year 4 Year 5

Month 1 xx xx xx xx xx

Month 2 . . . . .

Month 3 . . . . .

Month 4 . . . . .

Month 5

Month 6

Month 7

Month 8

Month 9

Month 10

Month 11

Month 12

Average: xx.xx xx.xx xx.xx xx.xx xx.xx

St. Dev.: xx.xx xx.xx xx.xx xx.xx xx.xx

REPORT SUMMARY:

Minimum temp is xx degrees F in month xx, year x.

Maximum temp is xx degrees F in month xx, year x.

*****************************************************

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

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago

Question

4. Design a career management system.

Answered: 1 week ago