Question: Here is the code from the previous three steps: #include using namespace std; class Student { private: //class variables int ID; string firstName,lastName; public: Student(int

 Here is the code from the previous three steps: #include using

Here is the code from the previous three steps:

#include using namespace std;

class Student { private: //class variables int ID; string firstName,lastName; public: Student(int ID,string firstName,string lastName) //constructor { this->ID=ID; this->firstName=firstName; this->lastName=lastName; } int getID() //getter method { return ID; } virtual string getType() = 0; //pure virtual function virtual void printInfo() //virtual function to print basic details of a student { cout supervisor=supervisor; this->thesis=thesis; } void printInfo() //method to print the additional details of a student { Student::printInfo(); cout

int main() //main method to test the functions { ResearchStudent r(101,"Debjit","Ganguli","Debayan Ganguly","AI"); r.printInfo(); TaughtStudent t(102,"Indrajit","Ghosh"); t.registerFor("AI"); t.registerFor("ML"); t.printInfo(); return 0; }

Q6. Write a function (not a method of a class) void student Tester) which contains code to test the classes you have developed in the previous three questions. When this function is called it should: Create two research students .Create two taught students, and register them for three modules each .Make an array of pointers to Student and point the elements of the array at your four student objects. Run a for loop which calls each student's printinto0 method, using the array of pointers

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!