Comp 1671, Autumn 2002
Programming Project 2
Assigned September 25, 2002
Due Friday, October 4, 2002

These are the instructions for your second programming project. Recall that all code must be written individually and independently.

The purpose of this program is to calculate final quarter grades for students in this class. Remember that quarter grades in this class are calculated as follows: First, a weighted average of the grades in each category is computed. The weights are as follows:

This calculation gives a numerical average for the student's coursework for the quarter. Letter grades are then assigned as follows: In addition, if the student's project average is below 69.5, then the grade cannot be higher than a D. (Note: for the purposes of this project, you'll just calculate a letter grade as above. However, for your actual course grades, I'll give letter grades with +/- qualifiers.)

Your program should prompt the user for the student's name (first and last), and then ask them for the student's grades in each of the 5 categories. It should then calculate the student's numerical average for the quarter and the letter grade. Your program should output both the numerical average and the letter grade in an easy-to-understand message that includes the student's name. If the grade was reduced because of a low project score, indicate that as well.

This project requires that you pay careful attention to how you round numbers. The numerical course average you calculate should be rounded, not truncated. For example, a 69.5 should earn a C, not a D. Round after the calculation of the course average - do not round the values of the individual grade components. This issue can be handled in a variety of ways in your source code, but must be addressed.

Since this program contains multiple logical choices, you'll need to test your program on a wide variety of input. It will not suffice to try your program on one or two sets of input data and assume it works for all possibilities. Make sure you do this testing thoroughly.

Here is a sample program output. Your output may vary in appearance, formatting, and the exact language you use, but should behave the same logically.


ftl> project2

Enter the student's name (firstname lastname): Pat Smith
Please type the student's scores in this order:
homework projects midterm-exam final-exam lab: 85.2 92 70 84 100
Pat Smith: 85.44, B

ftl> project2

Enter the student's name (firstname lastname): Chris Jones
Please type the student's scores in this order:
homework projects midterm-exam final-exam lab: 78 51.5 84 73 89
Chris Jones: 71.35, D (Grade was decreased due to a failing project grade)

ftl> project2

Enter the student's name (firstname lastname): JJ Davis
Please type the student's scores in this order:
homework projects midterm-exam final-exam lab: 94.2 98 88 91 99
JJ Davis: 93.94, A

ftl> project2

Enter the student's name (firstname lastname): Close Call
Please type the student's scores in this order:
homework projects midterm-exam final-exam lab: 69.5 69.5 69.5 69.5 69.5
Close Call: 69.5, C

ftl>

Instructions for submitting:
As always, don't forget that your program should start with a few lines of comments giving your name, the date, the course this is for, and the assignment number. You should also include a few lines that describes what the program does and how to use it. The program should be written with a well organized structure, and the variables should be named in a useful way. The program should be formatted consistently and clearly, and should include comments that explain the code. The program should compile without any compiler warnings. When you're done writing and testing the program, print out a copy of your source code. Also print out a copy of the output of your program, which shows how the program works for several sets of input data. Bring these to class on the due date and turn them in at the beginning of class. Also, before the beginning of class on the due date, mail your source code (your ".cpp" file) to comp1671@cs.du.edu. Do not include it as the message, instead make it an attachment to the email.

If you need further challenge:
Most of these modifications to the program requires you to learn some extra material. I'm happy to help you with this if you make an appointment with me.