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 i.e FullTimeEmployee and PartTimeEmployee.
Full-time employees are paid R500 per hour, while part-time employees are paid R750 per hour. For full-time employees, any hours worked over 40 should be considered overtime and paid at 2 times the hourly rate. For part-time employees, any hours worked over 20 should be considered overtime and paid at 1.5 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
1. Ask the user to input whether the employee is part-time or full-time.
2. Ask the user to input the number of hours worked by the employee.
3. Calculate the employee's total pay based on the input (part-time or full-time) 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 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 Programming Questions!