Create a class Employee that has a field for storing the complete name of the employee (first and last name), a field for storing the identification number of the employee (ID), and another field for storing his salary.
Create a class Employee that has a field for storing the complete name of the employee (first
and last name), a field for storing the identification number of the employee (ID), and another
field for storing his salary.
Provide
1. a no-argument constructor for initializing the fields to default values.
2. a 3-argument constructor for initializing the fields to values sent from outside. Use
strcpy function to copy one string into another.
3. a setter function (mutator) that sets the values of these fields by getting input from the
user.
4. an accessor function to display the values of the fields.
Derive three classes from this employee class: Manager, Scientist, and Laborer. Manager
class has an additional data member of # of subordinates. Scientist class contains additional
information about # of publications. Laborer class is just similar to the employee class. It has no
additional capabilities. Derive a class foreman from the Laborer class that has an additional
data member for storing the percentage of quotas met by a foreman. Provide appropriate
no-argument and n-argument constructors for all the classes. Provide the overridden getter and
setter functions here too to input and output all the fields. Determine whether public, private, or
protected inheritance should be used.
Step by step
Solved in 2 steps