Problem

Power Plant Data. The data file power1.dat contains a power plant output in mega watts ove...

Power Plant Data. The data file power1.dat contains a power plant output in mega watts over a period of 8 weeks. Each row of data contains 7 integers that represent 1 week’s data. In developing the following programs, use symbolic constants NROWS and NCOLS to represent the number of rows and the number of columns in the array used to store the data. (Generate a file to test these problems.)

Write a program that uses the function written in Problem to print a report that lists the average power output for the first week, then for the second week, and so on. Print the information in this format:

Week x: Average Power Output in Megawatts: xxxx.xx

Problem

Write a function to compute the average of a specified row of a two-dimensional array that has NROWS rows and NCOLS columns. The parameters should be the integer array and-4.0the desired row. Assume that the corresponding function prototype is

double row_ave(int x[NROWS,NCOLS],int row);

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search