Question: Payroll System Using Inheritance and Polymorphism ( C + + ) You need to implement the following header file and classes. 1 . Define the
Payroll System Using Inheritance and Polymorphism C
You need to implement the following header file and classes.
Define the following constants in a header file called Employee.h
FACULTYMONTHLYSALARY
STAFFMONTHLYHOURSWORKED
Implement an abstract class Employee with the following requirements:
Attributes
last name String
first name String
ID number String
Default argument constructor and argument constructors.
Public Methods
putData that displays the following information:
ID Employee number :
Employee name:
pure virtual method monthlyEarning that returns the monthly earning.
Implement a class called Staff extending from the class Employee with the following requirements:
Attribute
Hourly rate
Default argument and argument constructors
Public Methods
get and set
The method monthlyEarning returns monthly salary hourly rate times
putData that displays the following information:
ID Employee number :
Employee name:
Full Time
Monthly Salary:
Implement a class Education with the following requirements:
Attributes
Degree MS or PhD String type
Major Engineering Chemistry, English, etc String type
Research number of researches
Default argument and argument constructors.
Public methods
get and set
Implement a class Faculty extending from the class Employee with the following requirements:
Attributes
Level use enum statement
AS: assistant professor
AO: associate professor
FU: professor
Education object
Default argument and argument constructor
Public Methods
get and set
The method monthlyEarning returns monthly salary based on the faculty's level.
AS faculty monthly salary
AO times faculty's monthly salary
FU times faculty's monthly salary
putData that displays the following information:
ID Employee number :
Employee name:
XXXXX Professor where XXXXX can be Assistant, Associate or Full
Monthly Salary:
Implement a class called Partime extending from the class Staff with the following requirements:
Attributes
Hours worked per week
Default argument and argument constructors
Public Methods
set and get
The method monthlyEarning returns monthly salary which hourly rate multiplied by hours worked per week multiplied by four.
putData that displays the following information:
ID Employee number :
Employee name:
Hours works per month:
Monthly Salary:
Implement a test driver program that creates an array or a vector of class Employees to store the objects Staff, Faculty, and Partime.
Using polymorphism, display all employees using the method putData.
Use the following data to create Employee objects in your program.
Staff
Last name: Allen
First name: Paita
ID:
Hourly rate: $
Last name: Zapata
First Name: Steven
ID:
Hourly rate: $
Last name:Rios
First name:Enrique
ID:
Hourly rate: $
Faculty
Last name: Johnson
First name: Anne
ID:
Level: Full
Degree: PhD
Major: Engineering
Reseach:
Last name: Bouris
First name: William
ID:
Level: Associate
Degree: PhD
Major: English
Reseach:
Last name: Andrade
First name: Christopher
ID:
Level: Assistant
Degree: MS
Major: Physical Education
Research:
Parttime
Last name: Guzman
First name: Augusto
ID:
Hourly rate: $
Hours worked per week:
Last name: Depirro
First name: Martin
ID:
Hourly rate: $
Hours worked per week:
Last name: Aldaco
First name: Marque
ID:
Hours worked per week:
Runtime output
ID Employee number:
Employee name: Paita Allen
Full Time
Monthly Salary:
ID Employee number:
Employee name: Steven Zapata
Full Time
Monthly Salary:
ID Employee number:
Employee name: Enrique Rios
Full Time
Monthly Salary:
ID Employee number:
Employee name: Anne Johnson
Full Professor
Monthly Salary:
ID Employee number:
Employee name: William Bouris
Associate Professor
Monthly Salary:
ID Employee number:
Employee name: Christopher Andrade
Assistant Professor
Monthly Salary:
ID Employee number:
Employee name: Augusto Guzman
Hours work per month:
Monthly Salary:
ID Employee number:
Employee name: Martin Depirro
Hours work per month:
Monthly Salary:
ID Employee number:
Employee name: Marque Aldaco
Hours worked per month:
Monthly Salary:
Continuing on lab assignment, you need to modify the main function to output to the console window the following:
Total monthly salary for all the staff
Total monthly salary for faculty
Total monthly salary for parttime
Total monthly salary for all employees
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
