CS150 Fall 2001

Final Programming Project - Phase 1 (20 Points)

Due: Tuesday, November 27 by 2:45pm

Develop a class to represent a CS150 Student. Name the class CS150Student. Each student object will have the following eight (8) data members: id number, first name, last name, quiz1, quiz2, final, total lab score, and total project score. The id number will be a 4 digit integer, the first and last name should be strings (or cstrings) and values for all scores will be between 0 and 100. (Note no range checking is needed - assume valid entries will be made for each field).

You must also provide member functions that do the following:

Write a main function (contained in a separate source file named lastNameP6.cpp) that tests all aspects of your class. Write a main that does at least the following:


Calculating the weighted score:
The member function average() should compute the weighted average and return this value

the final test score is worth twice the quiz scores, therefore, there are 400 points possible for tests
divide the sum of the test scores by 400 to get a percent of the total
next multiply this precentage by .55 (weight of score) to get testScore component
testScores = ((q1 + q2 + 2 * final) / 400.00 ) * 0.55 //integer division here can cause hard to find problems
ex: q1 = 50; q2 = 50; final = 50 -> (200/400.00) * 0.55 = 0.275

For the lab and project component make a similar calculation.
each of the 14 labs are worth 5 points for 70 points total
the projects will be worth 140 points
workScores = ((labTotal + projectTotal) / 210.00 ) * 0.45
ex: labTotal = 35, projectTotal = 70 -> (105/210) * 0.45 = 0.225

add these two scores together and multiply by 100 to get a number between 0 and 100
ex: (0.275 + 0.225) * 100 = 50 percent


letterGrade:
The member function letterGrade(double avg) should compute the letter grade based on the weighted average and return this value as a char.

90 - 100 -> A
80 -  89 -> B
70 -  79 -> C
60 -  69 -> D
59 -   0 -> F


Sample Program Run: (user input in bold)

assume the program has declared four objects (s1, s2, s3, s4) and initialized them as follows.
s1 - using the default constructor
s2 - using the 3 arg constructor with (4321, "Kelly", "Jones")
s3 - using the 8 arg constructor with (8712, "Jade", "Stone", 82, 72, 94, 68, 126)
s4 - using the 8 arg constructor with (2379, "Ryan", "Wong", 82, 74, 73, 55, 102)

Enter data for student number 1
Enter Id number, First name, and Last Name: 8322 Audrey Brill
Enter scores for mid1, mid2, final, labs, projects: 76 76 82 58 90
Enter data for student number 2
Enter quiz1, quiz2, final, lab total, project total 88 81 78 55 80

//program output
idNum          name     mid1  mid2  final  labs  proj  average  grade
 8322     Audrey Brill    76    76     82    58    90    75.16    C
 4321      Kelly Jones    88    81     78    55    80    73.62    C
 8712       Jade Stone    82    72     94    68   126    88.60    B
 2379        Ryan Wong    82    74     73    55   102    75.17    C


NOTES:

What to submit:

lastNameP6 Project folder
lastNameP6.cpp Source file containing main and supporting functions
CS150Student.h Header file containing CS150Student class declaration
CS150Student.cpp Source file containing CS150Student member function definitions