Note: Could you plz go through this code and let me
know if u need any changes in this.Thank You
_________________
// temperatures.txt
Centerville-Temperature
12 5
10.8 4.6 16.2 13.35 14.95
12.65 4.7 7.9 23.8 24.35
17.25 22.45 33.6 38.35 29.65
33.85 40.35 47.15 43.85 45.65
57.6 57 55 60.6 57
67.55 67.2 67.15 68.8 67.85
71.75 69.4 72.55 71.85 72.1
70.95 69.3 69.45 70.25 66.8
63.45 60.85 65.6 62.7 61.95
44.8 48.45 50.8 49.35 47.5
23.3 22.95 36.3 41.8 28.4
4.2 21.2 23.2 16.15 14.45
______________________
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
int main() {
int rows, cols, i, j;
char name[50];
FILE * f1, * f2;
//Opening the input file in read mode;
f1 = fopen("temperatures.txt", "r");
if (f1 == NULL) {
printf("** input_numbers.txt File not found **\n");
} else {
fscanf(f1, "%s%d%d", & name, & rows, & cols);
float temps[rows][cols];
float avgs[rows];
//Reading the data from the file and populate into array
for (i = 0; i < rows; i++) {
for (j = 0; j < cols; j++) {
fscanf(f1, "%f", & temps[i][j]);
}
}
//closing the input file
fclose(f1);
//Opening the output file
f2 = fopen("temp_report.txt", "w");
fprintf(f2, "%s\n",
"************************************************");
printf("*************************************************\n");
fprintf(f2, "\t%s\n", "Year 1 Year 2 Year 3 Year 4 Year5");
printf("\tYear 1 Year 2 Year 3 Year 4 Year5\n");
for (i = 0; i < rows; i++) {
printf("Month %d:", (i + 1));
fprintf(f2, "Month %d:", (i + 1));
for (j = 0; j < cols; j++) {
printf("%-6.2f ", temps[i][j]);
fprintf(f2, "%-6.2f ", temps[i][j]);
}
printf("\n");
fprintf(f2, "\n");
}
float sum = 0, avg = 0.0;
printf("Average:");
fprintf(f2, "%s", "Average:");
//calculating the average
for (i = 0; i < cols; i++) {
sum = 0.0;
for (j = 0; j < rows; j++) {
sum += temps[j][i];
}
avg = sum / rows;
avgs[i] = avg;
printf("%-6.2f ", avg);
fprintf(f2, "%-6.2f ", avg);
}
printf("\nSt. Dev.:");
fprintf(f2, "%s", "\nSt. Dev.:");
float standardDev, sum2 = 0.0;
//calculating the standard deviation
for (i = 0; i < cols; i++) {
sum2 = 0.0;
for (j = 0; j < rows; j++) {
sum2 += pow((temps[j][i] - avgs[i]), 2);
}
standardDev = sqrt((sum2) / (rows));
printf("%-6.2f ", standardDev);
fprintf(f2, "%-6.2f ", standardDev);
}
printf("\nREPORT SUMMARY:\n");
fprintf(f2, "\n%s\n", "REPORT SUMMARY:\n");
float min, max;
int minindx = 0, maxindx = 0, minYear = 0, maxYear = 0;
min = temps[0][0];
max = temps[0][0];
//finding the min amd max temps
for (i = 0; i < rows; i++) {
for (j = 0; j < cols; j++) {
if (min > temps[i][j]) {
min = temps[i][j];
minindx = i;
minYear = j;
}
if (max < temps[i][j]) {
max = temps[i][j];
maxindx = i;
maxYear = j;
}
}
}
printf("Minimum temp is %.2f degrees F in month %d, year %d.\n",
min, (minindx + 1), (minYear + 1));
printf("Maximum temp is %.2f degrees F in month %d, year %d.\n",
max, (maxindx + 1), (maxYear + 1));
fprintf(f2, "Minimum temp is %.2f degrees F in month %d, year
%d.\n", min, (minindx + 1), (minYear + 1));
fprintf(f2, "Maximum temp is %.2f degrees F in month %d, year
%d.\n", max, (maxindx + 1), (maxYear + 1));
fprintf(f2, "%s\n",
"************************************************");
printf("*************************************************\n");
fclose(f2);
}
return 0;
}
______________________________
Output: (Console)

___________________________
// temp-report.txt (output file)

_______________Could you plz rate me well.Thank
You
ENGR 200 FALL 2019 P8: TEMPERATURE ANALYSIS (input/output files, if structures, for loops, two-dimensional array, one-dimensional...
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...
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. You should also have a parallel array to store the names of the 12 months. The program should read the Month's names, and the temperatures from a given input file called temperature.txt. The program should output the highest and lowest temperatures for the year, and the months that correspond to those temperatures. The program must use the following functions:...
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions 1. Function getData: This function reads and stores data in the two- dimensional array. 2. Function averageHigh: This function calculates and returns the aver- age high temperature for the year. 3. Function averageLow:...
Program 5 Due 10/25 C-String and Two-dimensional Array Use An input data file starts with a student's name (on one line). Then, for each course the student took last semester, the file has 2 data lines. The course name is on the first line. The second line has the student's grade average (0 to 100) and the number of credits for the course Sample data: Jon P. Washington, Jr. Computer Science I 81 4 PreCalculus 75 3 Biology I 88...
Write a C++ program that demonstrates use of programmer-defined
data structures (structs), an array of structs,
passing an array of structs to a function, and returning a struct
as the value of a function. A function in the program should read
several rows of data from a text file. (The data file should
accompany this assignment.) Each row of the file contains a month
name, a high temperature, and a low temperature. The main program
should call another function which...
Problem: You will write a program to compute some statistics based on monthly average temperatures for a given month in each of the years 1901 to 2016. The data for the average August temperatures in the US has been downloaded from the Climate Change Knowledge Portal, and placed in a file named “tempAugData.txt”, available on the class website. The file contains a sequence of 116 values. The temperatures are in order, so that the first one is for 1901, the...
CIS Department Fill Rates (Absolutely no two-dimensional arrays or vectors may be used) Purpose: Under the new De Anza College budgetary measures, fill rates will determine the number of sections offered by a department and whether a given class will be canceled or not. In this program you will write a C++ program to determine fill rates and output reports needed by the CIS department. See file Lab 7FillRates.txt . Use precisely six parallel arrays: string for course CRN number,...
Problem: You will write a program a C++ to compute some statistics based on monthly average temperatures for a given month in each of the years 1901 to 2016. The data for the average August temperatures in the US has been downloaded from the Climate Change Knowledge Portal, and placed in a file named “tempAugData.txt”, available on the class website. The file contains a sequence of 116 values. The temperatures are in order, so that the first one is for...
Write a program that demonstrates use of programmer - defined
data structures. Please provide code! Thank you.
Here are the temps given:
January 47 36
February 51 37
March 57 39
April 62 43
May 69 48
June 73 52
July 81 56
August 83 57
September 81 52
October 64 46
November 52 41
December 45 35
Janual line Iranin Note: This program is similar to another recently assigned program, except that it uses struct and an array of...
I need this asap. C++ please
A A Ap Aa Consolas 14 AaBbCcDd AaBbCcDd AaBbCc Editing ste 1 No Spac.. Heading 1 В I 1 Normal x A U A v ab х. Dictate ipboard Font Paragraph Styles Voice Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program...