Question: C++ language Were going to create an abstract base class with a couple of derived classes to boot. These classes will have dynamic memory, so

C++ language

Were going to create an abstract base class with a couple of derived classes to boot. These classes will have dynamic memory, so be sure to define the members of the rule of 3.

Base.h/cpp

Create a Base class. This will be our ABC that will serve as our blueprint/contract for our derived classes. Give the class the DisplayRecord function, and make it be pure virtual.

Employee.h/cpp

This will be the derived class that deals with employees. Add the data members for name, salary, and department. The name and department should both be char pointers (NOT strings!), meaning dynamic memory. Make sure that this class has the appropriate members of the rule of 3 created, so that we can safely do deep copies.

Student.h/cpp

The student should have a name, degree program, GPA, and likeability rating. The name and degree program should again be char pointers and not strings. As with the employee, make sure you set up the rule of 3 for a deep copy.

Dont forget to use the console lock/unlock if you dont like flicker.

Clearing the buffer is a good idea (we talked about a couple of ways to do that), just to make sure any information remaining in the cin input buffer isnt accidentally pushed elsewhere.

Make sure you have your paranoia check in your assignment operator!

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!