QUESTION 4 (use c++ to answer the following question) 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:  Hourly Employee Hours Worked: hours Rate: Pay:   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:  Salaried Employee Regular Pay:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

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