Need help with Week 5 ilab for cis247a i L A B O V E R V I E W Scenario and Summ
ID: 3644877 • Letter: N
Question
Need help with Week 5 ilab for cis247ai L A B O V E R V I E W
Scenario and Summary
The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:
1. Create a derived class called Salaried that is derived from Employee.
2. Create a derived class called Hourly that is derived from Employee.
3. Create generalized input methods that accept any type of Employee or derived Employee object
4. Create generalized output methods that accept any type of Employee or derived Employee object
5. Override the base class CalculatePay method
6. Override one of the base class CalculateWeeklyPay methods
Deliverables
Due this week:
Explanation / Answer
Derived Class Constructors The constructor for the base class Employee should set the values of the base class private variables. Employee::Employee (string new_name, double new_salary) { name = new_name; salary = new_salary; } The constructor for the derived class Manager should set the new private variable dept. We will use the Employee constructor to set thename and salary. Manager :: Manager(string new_name, double new_salary, string new_dept) : Employee(new_name, new_salary) { dept = new_dept; } class ProductionWorker : public Employee { private: int Shift; double HourlyPayRate; public: void setShift(int); void setHourlyPayRate(double); int getShift() const; double getHourlyPayRate() const; ProductionWorker(); }; void ProductionWorker::setShift(int a) { Shift = a; } void ProductionWorker::setHourlyPayRate(double b) { HourlyPayRate = b; } int ProductionWorker::getShift() const { return Shift; } double ProductionWorker::getHourlyPayRate() const { return HourlyPayRate; } ProductionWorker::ProductionWorker() { 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.