Modify class GradeBook (GradeBook.cpp, and GradeBook.h) (attached) as follows: a) Include a second private data member instructorName in the GradeBook class. It represents the course instructor’s name. The data type of the instructorName is a string. b) Create a new setInstructorName function in the GradeBook class. The function sets the instructor name. It accepts a string argument and does not return anything. c) Create a new getInstructorName function in the GradeBook class. The function retrieves the instructor name. It does not accept any argument and returns one string data. d) Modify the constructor to accept two parameters—one for the course name and one for the instructor’s name. e) Modify member function displayMessage such that it will display the welcome message and course name, then outputs "This course is presented by: " followed by the instructor’s name. f) Adjust all the necessary statements in the GradeBook.cpp file to display the required space(s) and line space(s).
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Modify class GradeBook (GradeBook.cpp, and GradeBook.h) (attached) as follows:
a) Include a second private data member instructorName in the GradeBook class. It
represents the course instructor’s name. The data type of the instructorName is a string.
b) Create a new setInstructorName function in the GradeBook class. The function sets
the instructor name. It accepts a string argument and does not return anything.
c) Create a new getInstructorName function in the GradeBook class. The function
retrieves the instructor name. It does not accept any argument and returns one string data.
d) Modify the constructor to accept two parameters—one for the course name and one for
the instructor’s name.
e) Modify member function displayMessage such that it will display the welcome
message and course name, then outputs "This course is presented by: " followed by the
instructor’s name.
f) Adjust all the necessary statements in the GradeBook.cpp file to display the required
space(s) and line space(s).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps