Question: Using c + + Develop a class Employee to manage employee payroll. Create a class called Employee with members name, age, hoursWorked, and hourlyRate. The
Using c Develop a class Employee to manage employee payroll. Create a class called Employee with members name, age, hoursWorked, and hourlyRate. The program should include two subclasses of the Employee type ie FullTimeEmployee and PartTimeEmployee.
Fulltime employees are paid R per hour, while parttime employees are paid R per hour. For fulltime employees, any hours worked over should be considered overtime and paid at times the hourly rate. For parttime employees, any hours worked over should be considered overtime and paid at times the hourly rate.
Use polymorphism to define methods to calculate the employee's total pay in each subclass, including overtime if applicable and display the results.
Implement the following steps
Ask the user to input whether the employee is parttime or fulltime.
Ask the user to input the number of hours worked by the employee.
Calculate the employee's total pay based on the input parttime or fulltime and the number of hours worked, including overtime pay if applicable.
Display the employee's name, age, hourly rate, total hours worked, regular pay, overtime pay if applicable and total pay.
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
