Due Date:
Midnight, Thursday May 1
Note: No late projects will be accepted.
Point Value:
This assignment is worth 80 points.
Objectives:
Assignment:
Background
The Registrar's Office at UMBC would like you to summarize some student information for them. They will provide you with a list of student records where each record contains a student's class rank (e.g., sophomore), identification number (four digits), and grade point average (GPA). Your program must display this information in a tabular format, with column headers, and also compute and display the following:
The C Code
A data file containing the necessary program input (proj6.dat
)
will be provided. Note that
this file will not end with a sentinel value. It is up to your program to
detect the end-of-file (EOF) character.
To use the data file as input to your program, you will use Linux redirection.
By using redirection, you can tell Linux to read data from a 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. But 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:
You will need to copy the file proj6.dat into your directory. To do this, go to the directory where you would like to store proj6.dat. Then, use the following command to copy proj6.dat into the directory:
Other Notes
switch
statements, one for
computing the number of each class rank and one for displaying the words
"Freshman," "Sophomore," "Junior," and "Senior."
Your program should contain no other functions other than these four and the main function.
Sample Program Run
Here is an example of what an input data file might look like:
Your program's output should follow this EXACT format. (The values will be different because the data file proj6.dat is different.)
Coding Standards:
Note that you MUST adhere to the coding standards and indentation style given on the Projects home page. So read them carefully and immediately!
Project Submission:
Submit your project by e-mailing your source code (proj6.c) to Gaurav (jolly1@umbc.edu) as an attachment. Make the Subject of the e-mail Project 6 so that Gaurav knows what it is. Do NOT send your executable file (a.out) or the input data file (proj6.dat).