make averages make water
Compile and run the program averages.c. Its input and output was supposed to look like the following.
10 20 30 30 40 50 Average of the 6 values read is: 30.000000 There are 2 values equal to the average. The values greater than the average: 40 50 The values less than the average: 10 20Your task is to fix the output. You will also notice that this program is not well organized (everything is all in a single file) and not well documented (what few comments that are there do not describe the algorithm and do not describe the functions). So in addition to fixing the program, you should break this code up into .c separate source files with related functions together in a file, and provide the appropriate .h files. (Hint: take a look at the second problem and see if any of the functions here can help you there). You should also make sure the code you turn in is well documented with meaningful comments.
10 20 30 30 40 50 Average of the 6 values read is: 30.000000 There are 2 values equal to the average. There are 2 values greater than the average: 40 50 There are 2 values less than the average: 10 20Hint: It's reasonable to write functions like tableSmallerElements and tableLargerElements that return the number of values smaller or larger than some target value.
This problem is a tiny project program. Everything you need is in the directory ~ee160/Code.lect/Water. You will find three .h files ( water.h, meter.h, and reading.h), two .c files ( water.c and reading.c) and one data file, day1. A sample executable is also provided. Your task is to complete this program by writing the function compute_usage() in the file meter.c. The spec for the program is given here. (Hint: think about using functions from the previous problem and the previous labs to save yourself some time).
If you are in Section 001 use:
grade -lab13s1,ee160 *.c *.h makefileIf you are in Section 002 use:
grade -lab13s2,ee160 *.c *.h makefileIf you are in Section 003 use:
grade -lab13s3,ee160 *.c *.h makefileIf you are in Section 004 use:
grade -lab13s4,ee160 *.c *.h makefileYou should verify that you turned in things successfully, which you can do with the command (which simply leaves the file names off from the previous command).
grade -lab13s1,ee160 OR grade -lab13s2,ee160 OR grade -lab13s3,ee160