Question: Modify class GradeBook as follows: a) Include a second string data member that represents the course instructors name. b) Provide a set function to change

 Modify class GradeBook as follows: a) Include a second string data

Modify class GradeBook as follows:

a) Include a second string data member that represents the course instructors name.

b) Provide a set function to change the instructors name and a get function to retrieve it.

c) Modify the constructor to specify course name and instructor name parameters.

d) Modify function displayMessage to output the welcome message and course name, then the string "This course is presented by: " followed by the instructors name.

e) Use your modified class in a test program that demonstrates the classs new capabilities.

f) Draw UML before coding.

Write the complete code in Answer, do not separate it in a, b, c parts.

member that represents the course instructors name. b) Provide a set function

------------------------------------------------------------ ((PLEASE SOLVE IN C++ LANGUAGE)) ------------------------------------------------------------

1 2 3 4 5 6 7 9 10 12 13 14 15 16 17 18 19 20 21 22 23 // Fig. 16.5: fig16_05.cpp // Define class GradeBook that contains a courseName data member // and member functions to set and get its value; 1/ Create and manipulate a GradeBook object with these functions. #include // program uses C++ standard string class using namespace std; // GradeBook class definition class GradeBook { public: ser function modifies private data // function that sets the course name void setCourseName( string name) { courseName = name; // store the course name in the object } // end function setCourseName // function that gets the course name ger function accesses private data string getCourseName() { return courseName; // return the object's courseName } // end function getCourseName 24 25 // function that displays a welcome message 26 void displayMessage() 27 { 28 // this statement calls getCourseName to get the 29 // name of the course this GradeBook represents 30 cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!