Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment: 2 9 April 2 0 2 4 ( please use only c not other programming languages ) ARRAYS, STRINGS, AND FILES MANIPULATION Exercise 1
Assignment: April please use only c not other programming languages
ARRAYS, STRINGS, AND FILES MANIPULATION
Exercise :Power Plant Data Management
The data file powertxt contains a power plant output in megawatts over a period of weeks. Each row of data contains
floatingpoint numbers that represent weeks data. In developing the following programs, use symbolic constants NROWS
and NCOLS to represent the number of rows and columns in the array used to store the data.
a Write a function to compute and print the average power output over this period. Also print the number of days with
greater than the average power output.
b Write a function to print the day of the week and the number of the week on which the minimum power output occurred.
If there are several days with minimum power output occurred. If there are several days with minimum power output,
print the information for each of these days.
c Write a function to compute the average of a specified column of a two dimensional array that has NROWS rows
and NCOLS columns. The parameters should be the floatingpoint array and the desired column. Assume that the
corresponding function prototype is
double colaveragedouble xNCOLSint col
d Write a program to print a report that lists the average power output for the first day of the week, then the second day of
the week, and so on Print the information in the following format:
Day x Average Power Output in megawatts: xxxxxx
e Write a program to print a report that lists the average power output for the week, the second week, and so on Print the
information in the following format:
Week x Average Power Output in megawatts: xxxxxx
f Write a program to compute and print the mean and variance of the power plant output data.
g Provide a driver program to test the functions above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started