Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

How does the "distance from the edge" effect your dominance style

Answered: 1 week ago

Question

What aspects would it be impossible to capture?

Answered: 1 week ago

Question

Enhance your words with effective presentation aids

Answered: 1 week ago