UMBC CS 104
UMBC CMSC 104 CSEE | 104 | current 104

CMSC 104, Spring 2003

Project 6 - Student Information

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:

a.out < proj6.dat This is how Linux redirection is done. It is saying to run your program and to read the input from the file proj6.dat, rather than the keyboard.

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:

cp /afs/umbc.edu/users/s/m/smitchel/pub/CS104/proj6.dat . Notice that the space and period at the end of the command are part of the command.

Other Notes

Sample Program Run

Here is an example of what an input data file might look like:

S 2486 3.25 R 3312 4.00 F 9123 2.86 F 4090 3.52 J 8125 2.55 S 7677 1.89 Here is the output that would result from using this sample data file:
Rank ID GPA Sophomore 2486 3.25 Senior 3312 4.00 Freshman 9123 2.86 Freshman 4090 3.52 Junior 8125 2.55 Sophomore 7677 1.89 Number of students: 6 Freshmen: 2 Sophomores: 2 Juniors: 1 Seniors: 1 Average GPA: 3.01

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).


Last Modified: Friday, 18-Apr-2003 14:19:17 EDT

Friday, 18-Apr-2003 14:19:17 EDT