Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi! Please write a C++ code that meets the requirements listed and comment each line. We use the How to Program Textbook by Deitel. And

Hi! Please write a C++ code that meets the requirements listed and comment each line. We use the How to Program Textbook by Deitel. And clearly mark where each file begins and ends.

image text in transcribed

YOu can find the supporting files here: https://we.tl/t-mNBmAxkdL9

Or you can find them in chapter 12 of the Deitel 'How to code' book. They're 12.9-12.17.

Problem 12.14 (Payroll System Modification) Modify the payroll system of Figs. 12.9-12.17 to include an 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 insurance 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 eanings Problem 12.14 (Payroll System Modification) Modify the payroll system of Figs. 12.9-12.17 to include an 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 insurance 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 eanings

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions