Question
Please solve this problem so that the result is the same as the uploaded picture. Please add the Team Leader class that inherits the Production
Please solve this problem so that the result is the same as the uploaded picture.
Please add the Team Leader class that inherits the Production Worker class from this code.
Design a class named Employee. The class should keep the following information in member variables:
Employee name (string)
Employee number (string)
Hire date (string)
Write one or more constructors and the appropriate accessor and mutator functions for the class. Next, write a class named ProductionWorker that is derived from the Employee class. (5 points)
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 1 and the night shift is shift 2.
Write one or more constructors and the appropriate accessor and mutator functions for the class. (5 points)
- 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 inherits from the ProductionWorker class you designed up. The TeamLeader class should have member variables for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Write one or more constructors and the appropriate accessor and mutator functions for the class. (5 points)
Demonstrate the class by writing a program that uses TeamLeader object by entering the following information:
Employee name:
Employee number:
Hire date:
Shift:
Hourly pay rate:
Fixed Monthly Bonus:
Minimum number of hours of training per year:
Driver program should use overloaded stream operator to display all information related to the created object. (5 points)
Expected output:
Please add the Team Leader class that inherits the Production Worker class from this code.
#include
using namespace std; class Employee { private: string employeeName; int employeeNumber; int hireDate; public: void setemployeeName(string employeeName); void setemployeeNumber(int); void sethireDate(int); string getemployeeName() const; int getemployeeNumber() const; int gethireDate() const; Employee(); }; void Employee::setemployeeName(string employeeName) { employeeName = employeeName; } void Employee::setemployeeNumber(int b) { employeeNumber = b; } void Employee::sethireDate(int d) { hireDate = d; } string Employee::getemployeeName() const { return employeeName; } int Employee::getemployeeNumber() const { return employeeNumber; } int Employee::gethireDate() const { return hireDate; } Employee::Employee() { cout > name; cout > num; cout > date; cout > shift; cout > pay; info.setemployeeName(name); info.setemployeeNumber(num); info.sethireDate(date); info.setShift(shift); info.sethourlyPay(pay); cout The employee name : Mark The Pay Rate : 30 The employee ID : 124586 The Hire Date : 20210721 Shift : Night Bonus Rate : 100 Training hours : 50 Required hours : 70
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