11 Create a class called STUDENT with data members firstname, lastname, age finalcwgrade and
12 finalexgrade and studentID.
13 Use a default constructor to initialize firstname to “Usain” and lastname to “Bolt”. Initialize
14 all other data members to zero.
15 Define a mutator that will accept values for the data members from the user and update each data
17 Define a function CalculateFinalGrade that will sum the final coursework grade and the final exam
18 grade and return the average of both grades.
19 Define a utility function that will check if the final grade is above 80, and prints the message
20 “This student is above average”. If the final grade is not above 80, then your program should
21 display “ This is an Average Student” This utility should be invoked by a display function.
22 The display function will display all the student’s information and whether or not the student is
23 average or above average.
24 Finally, write a main program that will implement the student class. Invoke the display function
25 before the user enters inputs to display default constructor values and should also be invoked
26 after the user inputs.
31 string firstname
, lastname
;
32 static int age
, studentID
;
33 static float finalcwgrade
, finalexgrade
, finalgrade
;
39 void setStudent(string fname
, string lname
, int ag
, int stID
, float cw
, float ex
){
47 float CalculateFinalGrade(){
48 finalgrade
= (finalcwgrade
+ finalexgrade
) / 2;
53 string assess
= "This student is above average";
58 string assess
= "This is an Average Student";
63 cout
<< setw(5) << "First Name" << setw(10) << "Last Name" << setw(5) << "Age" << setw(10)
64 << "StudentID" << setw(10) << "CW Grade" << setw(12) << "Exam Grade" << setw(12) <<
65 "Final Grade" << setw(10) << "Status" << endl
;
66 cout
<< setw(5) << firstname
<< setw(10) << lastname
<< setw(8) << age
<< setw(10) <<
67 studentID
<< setw(10) << finalcwgrade
<< setw(10) << finalexgrade
<< setw(10);
68 cout
<< CalculateFinalGrade();
76 int Student::studentID
= 0;
77 float Student::finalcwgrade
= 0.0;
78 float Student::finalexgrade
= 0.0;
79 float Student::finalgrade
= 0.0;
90 cout
<< "Enter First Name: \t";
92 cout
<< endl
<< endl
<< "Enter Last Name: \t";
94 cout
<< endl
<< endl
<< "Enter Age: \t";
96 cout
<< endl
<< endl
<< "Enter StudentID: \t";
98 cout
<< endl
<< endl
<< "Enter Final Coursework Grade: \t";
100 cout
<< endl
<< endl
<< "Enter Final Exam Grade: \t";
104 stud
.setStudent(fname
, lname
, age
, stID
, cw
, ex
);