Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

QUESTION 4 (use c++ to answer the following question)

  1. Note: You need to add required constructors/destructors, member functions or data members/variables in your program to complete its execution.

     

    Suppose we are designing a record-keeping program that has records for salaried
    employees and hourly employees. There is a natural hierarchy for grouping these classes.
    These are all classes of people who share the property of being employees.
    Employees who are paid an hourly wage are one subset of employees. Another
    subset consists of employees who are paid a fixed wage each month or week. Although the program may not need any type corresponding to the set of all employees, thinking in terms of the more general concept of employees can be useful. For example, all employees have names, Social Security numbers (ssn) and net pay, and the member functions for setting and changing the name, ssn and netpay would be same for both hourly and salaried employees.

     

    Implement the above mentioned record keeping program by creating an Employee class with data members name, ssn, and netpay. Include the default and parameterized constructors, member functions to set and get the data members. Also, write a printCheck function that should display error message that “printCheck Function Called for an undifferentiated employee”

     

    Create HourlyEmployee class (inherit from Employee class) with data members wageRate and hours (think rationally about the data types). Include the default constructor, parameterized constructor, setter, getter and printCheck function. The printCheck function should display the following output:

     

     

     

    Pay to the order of John Blue

    The sum of 10000 Dollars

    Check Stub: NOT NEGOTIABLE

    Employee Number:  <ssn>

    Hourly Employee

    Hours Worked: <hours> hours Rate: <wageRate> Pay: <netpay>

     

    Similarly, create SalariedEmployee, inherit from Employee class, with data member salary. Define the constructors, setter and getter methods and printCheck function. The printCheck function output should be as follows:

     

    _____________________________________________________________________

    Pay to the order of John Blue

    The sum of 10000 Dollars

    Check Stub: NOT NEGOTIABLE

    Employee Number:  <ssn>

    Salaried Employee

    Regular Pay: <salary>

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY