Question: This is worth up to six ( 6 ) points extra credit. Consider the following two classes. Write a constructor for the derived class that

This is worth up to six (6) points extra credit. Consider the following two classes. Write a constructor for the derived class that uses an initialization section and which correctly invokes the base class constructor.
class Student {
public:
Student(string newname, string newID) :
name(newname), ID(newID){}
private:
string name;
string ID;
};
class CITStudent: public Student {
public:
CITStudent(string newname, string newID, string newMajor);
private:
string major;
};

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 Programming Questions!