Question: language is c++ ****below is the test program to test the class****** #include #include #include #include #include #include // uncomment the following lines to test

 language is c++ ****below is the test program to test the

language is c++ ****below is the test program to test the class****** #include  #include  #include  #include  #include  #include  // uncomment the following lines to test your project #define testInstruct #define testStudent #define testJob #include "Instructor.hpp" #include "Student.hpp" using std::string, std::cout, std::endl, std::setw; void makePersonInfo(string &name, string & address); string makeHours(); float makeGPA(); int main() { unsigned int seed = static_cast(time(nullptr)); srand(seed); string name, address; const int NAMELEN = 15, ADDLEN = 15; #ifdef testInstruct cout getName(); address = theInstructors[i]->getAddress(); officeHrs = theInstructors[i]->getOfficeHours(); cout getName(); address = theStudents[i]->getAddress(); gpa = theStudents[i]->getGPA(); cout getName() getAddress() getJob() (rand()%100)/100.0; }

3) Instructor Student Problem (Polymorphism) Define a Person class with the following class variables string name and address. For methods it should have a default constructor that sets both variables to the empty string. It should have an overloaded constructor that takes parameters for all variables. Each variable should have a setter and a getter. There should be a method getjob that is hard coded to return the string "undefined". Define a class Instructor that is a Person. It should add the variable Office hours (a string) with setter and getter. It has a method getJob that is hard coded to return the string "instructor". Define a class Student that is a Person. It should add the variable GPA which is a float along with setter and getter. It has a method getJob that is hard coded to return the string "student". Use the test program in main to test your class

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!