Problem

(Payroll System Modification) Modify the payroll system of Figs. 1-9 to include additional...

(Payroll System Modification) Modify the payroll system of Figs. 1-9 to include additional Employee subclasses PieceWorker and HourlyWorker. A PieceWorker represents an employee whose pay is based on the number of pieces of merchandise produced. An HourlyWorker represents an employee whose pay is based on an hourly wage and the number of hours worked. Hourly workers receive overtime pay (1.5 times the hourly wage) for all hours worked in excess of 40 hours.

Class PieceWorker should contain private instance variables wage (to store the employee’s wage per piece) and pieces (to store the number of pieces produced). Class HourlyWorker should contain private instance variables wage (to store the employee’s wage per hour) and hours (to store the hours worked). In class PieceWorker, provide a concrete implementation of method earnings that calculates the employee’s earnings by multiplying the number of pieces produced by the wage per piece. In class HourlyWorker, provide a concrete implementation of method earnings that calculates the employee’s earnings by multiplying the number of hours worked by the wage per hour. If the number of hours worked is over 40, be sure to pay the HourlyWorker for the overtime hours. Add a pointer to an object of each new class into the vector of Employee pointers in main. For each Employee, display its string representation and earnings.

Fig 1. Employee abstract base class. (Part 1 of 2.)

Fig 1. Employee abstract base class. (Part 2 of 2.)

Fig 2. Employee class implementation file. (Part 1 of 2.)

Fig 2. Employee class implementation file. (Part 2 of 2.)

Fig 3. SalariedEmployee class header.

Fig 4. SalariedEmployee class implementation file. (Part 1 of 2.)

Fig 4. SalariedEmployee class implementation file. (Part 2 of 2.)

Fig 5. CommissionEmployee class header. (Part 1 of 2.)

Fig 5. CommissionEmployee class header. (Part 2 of 2.)

Fig 6. CommissionEmployee class implementation file. (Part 1 of 2.)

Fig 6. CommissionEmployee class implementation file. (Part 2 of 2.)

Fig 7. BasePlusCommissionEmployee class header.

Fig 8. BasePlusCommissionEmployee class implementation file. (Part 1 of 2.)

Fig 8. BasePlusCommissionEmployee class implementation file. (Part 2 of 2.)

Fig 9. Employee class hierarchy driver program. (Part 1 of 4.)

Fig 9. Employee class hierarchy driver program. (Part 2 of 4.)

Fig 9. Employee class hierarchy driver program. (Part 3 of 4.)

Fig 9. Employee class hierarchy driver program. (Part 4 of 4.)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT