Congratulations! You are the new Teaching Assistant for CMSC 104, Section 0102! As part of your job, you are to write a program to analyze the midterm exam scores for the class. Your program should compute
A data file containing the scores for you to use as input to your program will be provided. (NOTE: These are NOT the real scores from your midterm exams!) The scores are between 0 and 100, inclusive, and are in random order. The last value in the file is -1. This is the sentinel value that signals the program to stop reading scores.
To use the data file as input to your program, you will use UNIX redirection.
By using redirection, you can have UNIX fill the stdin
buffer from a data file
rather than from the keyboard. The scanf
statement that you use in your
program will look exactly the same as it would if you were getting your input
from the keyboard. Since you will be getting the values from a file instead of from a user typing at the keyboard, you will not need to prompt the user.
When you run your program, use the following command:
Here is an example of what the data file might look like:
Your program's output should follow this EXACT format.
Make sure that you follow the "C Coding Standards" and "Indentation Styles" given on the Projects web page. Your program will be graded not only on whether or not it produces the correct results, but also on whether or not you follow these standards and styles.