Create a class named ProductionWorker that is derived from the Employee class. T
ID: 3636073 • Letter: C
Question
Create a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have properties to hold the following data:• Shift number ( an integer, such as 1, 2, or 3)
• Hourly pay rate The workday is divided into two shifts: day and night. The Shift property 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. Create an application that creates an object of the ProductionWorker class and lets the user enter data for each of the object’s properties. Retrieve the object’s properties and display their values.a team leader is an hourly paid production worker that 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 is derived from the ProductionWorker class. The TeamLeader class should have properties for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Demonstrate the class in the application.
Explanation / Answer
++ Syntax (Toggle Plain Text) //This program demostrates a class and a derived class with constructors. #include #include #include using namespace std; class Employee { private: char EmpName; int EmpNum; int HireDate; public: void setEmpName(char); void setEmpNum(int); void setHireDate(int); char getEmpName() const; int getEmpNum() const; int getHireDate() const; Employee(); }; void Employee::setEmpName(char x) { EmpName = x; } void Employee::setEmpNum(int y) { EmpNum = y; } void Employee::setHireDate(int z) { HireDate = z; } char Employee::getEmpName() const { return EmpName; } int Employee::getEmpNum() const { return EmpNum; } int Employee::getHireDate() const { return HireDate; } Employee::Employee() { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.