Question: Today we will be adding inheritance so that we can specialize our classes, rather than simply using an attribute of WitPerson to indicate role. First,

 Today we will be adding inheritance so that we can specialize

Today we will be adding inheritance so that we can specialize our classes, rather than simply using an attribute of WitPerson to indicate role. First, modify your WitPerson class by adding the following method in the public section of your class: virtual string payMe(void) - e;A pure virtual function Next in your project, create 3 new header files to hold: WitFaculty class WitStaff class WitStudent class all of which publicly inherit from WitPerson. You'll want to implement payMe() differently for all 3 classes. You will no longer be able to instantiate an instance of WitPerson directly-only the 3 child classes. Remember that you'll also need to declare & implement your constructors, destructor, and assignment operator for each new class. When you run payMe),you'll print out the name of the person and the gross amount of their paycheck (forget taxes & deductions for now) on the screen. You will need to collect additional information for each class in your database. Faculty are paid a salary, so they are paid the same amount (whatever it is) each pay period Staff are usually paid on an hourly basis, so their pay is hours rate up to 40 hours, and they get time and a half for all hours over 40. The rate is steady, but hours may vary each period Students are hourly and work less than 40 hours. Their rate is generally less than staff In your main() function, when you are ready to create a new instance, you must create the appropriate child class using the new)operator. You should not need to modify the code that deals with your vectork> template. Run payMe) for each member in the database. Have a good week! Show me your program working and get my initials: ? Today we will be adding inheritance so that we can specialize our classes, rather than simply using an attribute of WitPerson to indicate role. First, modify your WitPerson class by adding the following method in the public section of your class: virtual string payMe(void) - e;A pure virtual function Next in your project, create 3 new header files to hold: WitFaculty class WitStaff class WitStudent class all of which publicly inherit from WitPerson. You'll want to implement payMe() differently for all 3 classes. You will no longer be able to instantiate an instance of WitPerson directly-only the 3 child classes. Remember that you'll also need to declare & implement your constructors, destructor, and assignment operator for each new class. When you run payMe),you'll print out the name of the person and the gross amount of their paycheck (forget taxes & deductions for now) on the screen. You will need to collect additional information for each class in your database. Faculty are paid a salary, so they are paid the same amount (whatever it is) each pay period Staff are usually paid on an hourly basis, so their pay is hours rate up to 40 hours, and they get time and a half for all hours over 40. The rate is steady, but hours may vary each period Students are hourly and work less than 40 hours. Their rate is generally less than staff In your main() function, when you are ready to create a new instance, you must create the appropriate child class using the new)operator. You should not need to modify the code that deals with your vectork> template. Run payMe) for each member in the database. Have a good week! Show me your program working and get my initials

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!