Question: IN PROGRAMMING LANGUAGE C (average.c) Redirect the input from a file rather than the standard keyboard. The file has 10 lines and 5 columns. Calculate

IN PROGRAMMING LANGUAGE C

(average.c) Redirect the input from a file rather than the

standard keyboard. The file has 10 lines and 5 columns. Calculate the

average for each line, and each column. The last number is the average of

the average for each row.

The format requirements: All scores take 10 spaces and are right aligned

as well. The average should be displayed with 2 digits after the decimal.

For example, if the input grade.txt has data:

80 80 84 88 100

90 95 90 95 100

50 60 45 65 100

90 95 90 95 100

80 80 84 88 100

90 95 90 95 100

90 95 90 95 100

50 60 45 65 100

90 95 90 95 100

80 80 84 88 100

Then the output of the following command

./average

Should be like this:

Should be like this:

IN PROGRAMMING LANGUAGE C (average.c) Redirect the input from a file rather

When this problem is graded, we will redirect your output to a file, then compare your output with an expected output. See the commands below. If diff command reports any difference between your output and the expected output, you will loose points. Please make sure you follow the specified format. For your convenience, I have included the grade.txt and expected_new_grade.txt with this assignment.

./average new_grade.txt

diff new_grade.txt expected_new_grade.txt

Then the output of the following command /average

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!