Question: In this lab, please define ONE base class Person and three derived classes Professor, Secretary, and Student Worker, For each derived class, you should define
In this lab, please define ONE base class Person and three derived classes Professor, Secretary, and Student Worker, For each derived class, you should define an integer data field num_vacation and an integer data field salary. Then you should use polymorphism to determine what type of vacation and salary each type of employee will have, as shown in the diagram below Int: age String: name Person -- Boolean: alive string: ssn Professor Secretary Student_ worker String: fac id String: fac_id String: ta id String Int: num, service String year int salary Int: salary Int: salary Int: vact Int: oum, vaction Int: vacti String course taught Use polymorphism to determine (1) the salary made for each type of person fac: monthly sec: bi-weekly ta: hourly and (2) the number of days for vacation fac: 3 months sec: 1 month ta: weekend
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
