Question
Step 1: Employee and ProductionWorker Classes First, design a class named Employee. The class should keep the following information in member variables: Employee name Employee
Step 1: Employee and ProductionWorker Classes
First, design a class named Employee. The class should keep the following information in member variables:
Employee name
Employee number
Hire date
Write one or more constructors and the appropriate member functions for the class.
Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information:
Shift (an integer)
Hourly pay rate (a double)
The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee works. The day shift is shift I and the night shift is shift 2. Write one or more constructors and the appropriate member functions for the class.
Demonstrate the classes by writing a program that uses a ProductionWorker object.
Sample Output:
Name: John Jones
Employee number: 12345
Hire date: 9/9/2014
Shift: Night
Shift number: 2
Pay rate: 16.00
Press any key to continue . . .
Step 2: TeamLeader Class
In a particular factory, a team leader is an hourly paid production worker who leads a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus. Team leaders are required to attend a minimum number of hours of training per year.
Design a TeamLeader class that extends the ProductionWorker class you designed in Step 1, The TeamLeader class should have member variables for the monthly amount, the required number of training hours, and the number of the appropriate accessor and mutator functions for the class.
Demonstrate the class by writing a program that uses a TeamLeader object.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started