Question: Note: In the next three questions you will create a set of classes that are related by inheritance. It is recommended that you read all

 Note: In the next three questions you will create a set

Note: In the next three questions you will create a set of classes that are related by inheritance. It is recommended that you read all three questions before writing any code. Sketching out a class diagram as you read the questions will help you to get a picture of the required structure of the classes (you do not need to submit this diagram). Q3. Write an abstract class to represent a Student A student has an ID, a first name and a last name. The ID should be an integer and the first and last names should be C++strings. The class must have the following methods A constructor that takes a student ID value, a first name and a last name A int getiD) method which returns the student's ID value A pure virtual method string getType) which, if implemented in any class derived from Student, would be expected to return the type of student as a string A virtual void printinfo() method which prints out the student's details. This method should call the getType() method to print out the student type as the first line of the printout. 10 marks Q4. Write a concrete class called Research Student which inherits from your Student class of question 3. A research student has a supervisor name (as a single C++ string) and a thesis titile (as a C++ string). The class must also have the following methods: A constructor taking the student's ID, first and last names, supervisor name and thesis title. This constructor calls the parent class constructor. A void printinfoo method that calls the parent class's printinfoo method to print generic student information and also prints details specific to a research student. . A method that provides an implementation (overrides) the base class pure virtual function get Type) This method should simply return the string "Research Student". [10 marks Q5. Write a concrete class called TaughtStudent which also inherits from your Student class. A taught student has an array of module names for which they are registered. This array can have up to 10 module names. A module name is a C++ string. Additionally, the class has a member numRegisteredModules which stores the number of modules for which the student is currently registered. The class must have the tollwing methos .A constructor taking the student's ID, first and last name. The constructor should set numRegisteredModules to 0 . A method bool registerFor(const string& moduleName) which adds a module to the students modules. If the student is already registered for 10 modules then this method should return false, otherwise it returns true A void printinfo() method that calls the parent class printinfo0 method and also prints details specific to a taught student, including their list of registered modules. .An override for the base class pure virtual function that returns the string "Taught Student

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!