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…
(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.)
Problem description:   (Malik,2017) Programming Exersices Problem 16, pág. 740, Cap 10 Write the definition of a class, swimmingPool, to implement the properties of a swimming pool. Your class should have the instance variables to store the length (in feet), width (in feet), depth (in feet), the rate (in gallons per minute) at which the water is filling the pool, and the rate (in gallons per minute) at which the water is draining from the pool. Add appropriate constructors to initialize the instance variables. Also add member functions to do the following: determine the amount of water needed to fill an empty or partially filled pool, determine the time needed to completely or partially fill or empty the pool, and add or drain water for a specific amount of time. Changes to do. Design a class, where its attributes are pointers Implement the copy constructor member function. Implement the waterfall effect, when entering the information. Use the this pointer to access the contents of…

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