C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 20, Problem 20.15E

(Payroll System Modification) Modify the payroll system of Figs20.9.—20.17 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 employees 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.

Blurred answer
Students have asked these similar questions
C++ Project ( Build the requested system 100% into a C++ environment, excluding Class framework & All defined variables must be represented as pointer type, int, char etc)Scenario:A bookshop (PRIMER BOOKSHOP) wants to maintain the inventory of books that are being sold at the shop. The list includes details such as author, title, price, publisher, and stock position. Whenever a customer wants a book, the sales personnel inputs the title and author, and the system searches the list and displays whether it is available or not.- If it is not, an appropriate message is displayed.- If it is, then the system displays the book details and requests for the number of copies required.- If it is requested, copies of the book details and requests for the number of copies required are available, the total cost of the requested copies is displayed and your system needs to update the database.- Sales personnel, from time to time are allowed to update the latest stock and price to the created…
erd (pls write it neatly because i cant read what was written last time someone answered it so i couldn't understand anything)
(Richer Shape Hierarchy) The world of shapes is much richer than the shapes included inthe inheritance hierarchy of Fig. 19.3. Write down all the shapes you can think of—both two-dimensional and three-dimensional—and form them into a more complete Shape hierarchy with asmany levels as possible. Your hierarchy should have the base class Shape from which class TwoDimensionalShape and class ThreeDimensionalShape are derived. [Note: You do not need to write any codefor this exercise.] We’ll use this hierarchy in the exercises of Chapter 20 to process a set of distinctshapes as objects of base-class Shape. (This technique, called polymorphism, is the subject ofChapter 20.)

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
functions in c programming | categories of function |; Author: Education 4U;https://www.youtube.com/watch?v=puIK6kHcuqA;License: Standard YouTube License, CC-BY