Optional Lab - Extra Credit

Classes and External Files

As usual, use good object-oriented techniques,use multiple files, document well, and provide a makefile.


Do #2 (which depends on #1 so read it also) from the text, page 603-4. Be sure to use classes not structures. You will also have a name input. The name is a maximum of 20 characters.


Use an input file with the name
myclass.dat and the following format

quiz1 quiz 2 midterm final name

The scores are integers, but the average is a double.


Use an output file with the name
grades.dat that has the following format:

name quiz1 quiz2 midterm final calculated-average letter-grade


For example, given the input file of myclass.dat:

6 8 40 90 William Burke

8 10 33 75 Jane Doe


The output file produced would be named grades.dat and would look like:


William Burke 6 8 40 90 72.5 C

Jane Doe 7 10 80 99 90.8 A


(Note that only 1 decimal point is printed for the Average.)

Some more extra credit if the fields are lined up in columns with a title of

NAMEQUIZ1QUIZ2MIDTERMFINALAVERAGEGRADE

==========================================================================