The purpose of this lab is to give you a chance to play with different loop constructs provided in C and different ways to organize loops. One of the things you will notice about the programs provided below, is that they are inadequately documented. Part of your job is to comment the programs you turn in to properly show the algorithms they are implementing. As usual, you should begin by creating a new directory called Lab10 in your EE160/Labs directory (which you have created in previous labs). All of the program files you write for this lab should be in this Lab10 directory.
5
10 20 30 40 50
Average of 5 values is 30.00
7
15 20 40 50 60 40 50
Average of 7 values is 39.29
5
10 20 30 40 50
Average of 5 values is 30.00
some garbage input
Error! Can't read number of expected values.
5
10 20 30 40 50
Average of 5 values is 30.00
6
50 70 whatever 40 60
Error! Can't read expected value #2.
Average of 2 values is 60.00
Use the "grade" command to turn in the all of the source files (.c and .h files) in your Lab10 directory. Your command will look like the following.
If you are in Section 001 use:
grade -lab10s1,ee160 *.c *.h
If you are in Section 002 use:
grade -lab10s2,ee160 *.c *.h
If you are in Section 003 use:
grade -lab10s3,ee160 *.c *.h
If you are in Section 004 use:
grade -lab10s4,ee160 *.c *.h
If you are in Section 005 use:
grade -lab10s5,ee160 *.c *.h
NOTE: this command will send in ALL files named with .c and .h extensions in the current directory which are really your files. The grade command will give you a message for files that are links and not submit the files - that is ok, we only want the files which you wrote. You 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 -lab10s1,ee160
OR
grade -lab10s2,ee160
OR
grade -lab10s3,ee160
OR
grade -lab10s4,ee160
OR
grade -lab10s5,ee160
NOTE: after the files are prepared for grading, you will no longer be able to see your file listing using the above command. NOTE: BE CAREFUL to use the correct form of the grade command given above. If you do not, your files will be sent to the wrong place, and we will not guarantee we will find them for grading.