Project 2: Student Records

Assigned:  25 February 2002

Homework Due:  3 March 2002

Project Due: 10 March 2002


Objective

The objective of this assignment is to practice writing C++ classes and using sorting algorithms.


Background

We want to write a program to keep track of student records.  Each student has a name, a student ID number, and a list of classes taken (including grades received).  We will input the student data from the user, order the students by GPA, and output the results.

 


Assignment

First, prompt the user for the number of students to be entered, which should be a number between 0 and 50, the maximum number of student records.  For each student, prompt the user for the name (a string which will not contain any whitespace), student ID (a positive integer), a number of classes taken (a nonnegative integer) and then classes taken, in that order.  The data for each class taken consists of a number of credits (nonnegative integer), and a letter grade (A, B, C, D, and F are the only 5 acceptable inputs for letter grade).  If invalid data is entered for any input, reprompt (for that value only, not the entire student record) until valid data is entered.

Once all the records have been read in, you will need to compute each student's GPA.  A GPA is given by the formula:

 [   ( number of credits )1 * ( quality points )1 + ( number of credits )2 * ( quality points )2 + ...
        ( number of credits )n * ( quality points )n ]  / [ total number of credits ]

       where n is the total number of courses taken and quality points are as follows:

        A = 4, B = 3, C = 2, D = 1, F = 0       (If a student has not taken courses, their GPA is 0.)

Finally, once the GPAs have been computed, print out (to cout) all student records in order of decreasing GPA.    For each student, print the name, student ID, GPA, and number of credits, in that order, all on one line separated by whitespace.

IMPORTANT: We will be automating the grading of this project, so you must make sure your output conforms to the specifications above.  Specifically, do not print any identifiers on the lines with the data; only the data itself should be printed out, as in the following example:

BillyBob   21874   2.93   87

 


Homework Portion

The homework portion of this project will be worth 15% of the project grade.  For the homework, create a plain text file (end the filename in .txt) which includes the prototypes of the functions you intend to use, the Student class definition you intend to use, and a one- to two-paragraph (approximately) description of how you intend to solve the problem and the general design of your program.  You may use pseudocode if you wish.  (This file is not intended to be compiled; it is only for you to express the design of your program.)  Your homework will be graded both on the merits of your design and on the extent to which you follow that design in the implementation of your program.  Remember to submit your homework file by the homework due date.  Late homework submissions are not accepted.


Requirements

  1. Write your program in C++, using the g++ compiler installed on the linux systems at UMBC (linux.gl.umbc.edu) under the /usr/local/bin directory. Use C++ input and output, not printf and scanf.  The graders will compile your code using the -ansi and -Wall switches, so make sure to test your program with these.  Also, make sure to explicitly specify the correct compiler and options in your makefile.
  2. As per the syllabus, your project must compile (under the above-mentioned compiler) in order to receive credit.  See the syllabus for more details.
  3. You must write a class named Student; objects of this type will hold the individual student records.  This class must contain a C++ string for the student name.  You may have any other fields, as you see fit.  As always, all fields (data members) must be private.  
  4. You may not use any sorting routines that you do not write yourself (such as the ones in the standard libraries), except for those given in this course.  Your source code may not include any portions that you do not write yourself.
  5. You must follow the course style guidelines listed on the course web page, including the creation and submission of a makefile.
  6. Write and submit separate header, class, and main files, as discussed in lecture.
  7. When designing your program, pay attention to the design considerations discussed in class.
  8. If you need more information on working with the string class, see the primer posted on the course web page, or the course textbook.


Turning in your program

You must include the following statement in a comment section of your program:

 

I have read and I understand the course policy on cheating. By submitting the following program, I am stating that the program was produced by my individual effort.

Turn in your homework and program using the UNIX submit utility, by using the following command at the unix prompt:

submit cs202_02 < hw2 | proj2 > filenames

where filenames is the name of the file(s) you wish to submit and hw2 or proj2 specifies the assignment you are submitting.  Remember to submit a plain text file for the homework assignment, your C++ source and header files for the project, and your makefile.  After entering this command, you should get a confirmation that each file submission was successful:

Submitting filename...OK

You can check your submission by entering the command:

submitls cs202_02 < hw2 | proj2 >

This will show the names of all files you have submitted for this homework or project, along with the size and submission date and time of each.  


Late Policy Reminder

This project is due by midnight (1 minute after 11:59pm) on Sunday, 10 March 2002. We will use the system clock as the final arbiter of time and date. Projects turned in up to 24 hours late will receive a 10% penalty; project submitted between 24 and 48 hours late will receive a 25% penalty.  Projects will not be accepted past 48 hours after the due date.  Late homework submissions are not accepted.