Question: Understand how to define classes and create objects. Understand inheritance and run - time polymorphism through virtual functions. Understand overloaded operators. Description: For this project,
Understand how to define classes and create objects. Understand inheritance and runtime polymorphism through virtual functions. Understand overloaded operators. Description: For this project, you will implement data structure using objectedoriented programming. You will create four classes: person, student, teacher and course. Person class has two attributes: they are name and age Person class has two methods that return the name and age attributes. Person class has one constructor and one destructor. Person class also has one virtual function called printname that print out the names of the person in the message: This is ### ### is the name. implement person.h and person.cpp file Student class is inherited from person class. Student class have two member variables attributes: student id number studentnum and a list of course arrays as class member that heshe is taking. Student class has four member methods: get id student number; print out the list of courses that heshe is taking; add courses to the list; delete courses in the list. Student class also has a friend function, which overloads operator to compare two students list of courses are equal or not. Student class overrides the virtual function printname from Person class. It prints out the message This is student ### ### is the name. Student class has one constructor and one destructor. implement student.h and student.cpp file Teacher class is inherited from person class. Teacher class has two more attributes: salary and a list of courses that heshe is teaching. Teacher class has two additional methods. One is to get the teachers salary, the other is to print out the course that heshe is teaching. Teacher class overrides the virtual function printname from Person class. It prints out the message This is teacher ### ### is the name. Teacher class has one constructor, one destructor. implement teacher.h and teacher.cpp file Course class has three attributes. They are course number, course name and course description. Course class has three methods to get its three attributes. Course class has one constructor and one destructor implement course.h and course.cpp file You also need to write a C test driver program called test.cpp to enter the data and finish the following tasks:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
