UMBC CMSC201, Computer Science I, Fall '98
Project 4: Student Records
Due date: Wednesday, November 25, 1998
You have been hired by the CSEE department as the CMSC 201 gradeskeeper.
One of your responsibilities is to generate reports. There are basically
two different kinds of reports. One type, called stats, gives the breakdown
of the number of students by major, by sex, by class (freshman, sophomore,
junior, senior) and by section. (I will give an example stats report.)
The other type of report is a grade report. Grade reports can be created for
an individual student, all the students of a specific section, or all students
in the class. You are to to write a program that prints out these reports
(TO AN OUTPUT FILE ONLY - NOT TO A PRINTER
), using the data found in the p4student.dat.
This project will give you practice with structs, file-handling, command-line
arguments, and of course design and separate compilation.
Description of the Program
In order to use your program, the person generating the reports should enter
the name of the executable and the name of the data file to be used as input
on the command line. The input file is called p4students.dat, in this case.
At this point the user should be presented with a main menu that allows him/her
to choose the type of report to generate.
S - Statistical report
G - Grade report
Q - Quit
Enter your choice :
- where choosing 'S' will immediately start generating the statistical
report, which should be written to a file called stats.txt.
- choosing 'G' will present the user with another menu, where s/he may select
'I' to create a grade report for an individual student,
'S' to select a section and genetate reports for all students enrolled in that
'A' to generate a grade report with averages by section and for the class as a
or 'R' to return to the main menu.
- and choosing 'Q' allows the user to quit.
After choosing any of these options, the appropriate action should take
place and then this menu should be presented to the user again. The user
must choose Q from this menu to end the program. Similarly, the user should
always be returned to the grades menu until s/he chooses 'R' to return to the
The records of the students are kept in ascending sorted order by login name
and has the information stored for each record in the following order:
login(max of 8 chars), lastName(max of 15 chars), firstName(max of 15 chars),
ssn(max of 11 chars), sex(char), major(max of 4 chars), section(max of 5
chars), class(max of 2 chars), p1(int), p2(int), p3(int), p4(int), p5(int),
q1(int), q2(int), q3(int), q4(int), q5(int), midterm(int), finalExam(int).
The file begins with a single integer which is the number of student records
in the file.
An example of the input file's format:
Design limitations and details
- You must read the entire contents of the input file, load the data
into an array of structs and close the file before presenting the initial
menu to the user.
- Since I have no interest in killing a forest, and none of you would
like to pay for a lot of printouts, the reports should NOT be sent
to a printer.
- The statistics report should be written to a file called stats.txt.
- There are several kinds of grade reports.
- A grade report for an individual student, whose login name is dheinz1,
should be written to a file called dheinz1.txt. It should include a
report of all his grades and his total course score and letter grade.
The course score can be determined by the following:
Each quiz score is out of 10 points and each quiz counts as 2% of the
Each project is worth 8% of the grade and is based on a score of 100.
Each exam grade is worth 25% of the grade and is based on a score of
- A grade report for an entire section, should consist of individual
grade reports for each student in that section separated by a long
line of dashes, as in:
and a section report that gives the section averages for each quiz,
project, and exam as well as the average total score for the students
in that section. These reports should be written to a file that is
named by the section number, i.e. 0101.txt.
- A grade report for the entire class should be composed of section
reports separated by lines of dashes and the class averages for
each quiz, project and exam, as well as the average of the total
scores for the entire class. This report should be written to a
file called CMSC201.txt
- You will be graded on your design and on the efficiency of the program,
as well as the correctness of the program, documentation and style.
Statistics Report for CMSC 201
students : 22
Sex: male : 13 59.091 %
female : 9 40.909 %
Major: CMSC : 9 40.909 %
IFSM : 8 36.364 %
other : 5 22.727 %
Class: freshmen : 5 22.727 %
sophomores : 10 45.455 %
juniors : 5 22.727 %
seniors : 2 9.091 %
Section: 0101 : 8 36.364 %
0102 : 6 27.273 %
0103 : 3 13.636 %
0104 : 3 13.636 %
0201H : 2 9.091 %
Copying the files
The file you need to use for this project is
The executable and the data file need to be in the same directory.
Submitting your project
Submit your projects as usual, using the submit command.