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.

Generate : S - Statistical report G - Grade report Q - Quit Enter your choice :

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 main menu.

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:

2 dheinz1,Heinz,Dan,987-65-4321,M,ENEE,0101,SR,84,91,94,82,99,7,8,9,9,8,90,92 sbogar1,Bogar,Sue,123-45-6789,F,CMSC,0201H,SO,85,92,95,83,100,8,9,10,10,9,91,93

Design limitations and details


Sample Output

Statistics Report for CMSC 201 Number Percentage 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 p4students.dat

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.