The objective of the lab is to take the UML Class diagram and enhance last week\
ID: 3634201 • Letter: T
Question
The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:
Due this week:
STEP 1: Understand the UML Diagram
Notice the change in UML diagram. It is common practice to leave out the properties or (accessors and mutators - getters and setters) from UML class diagrams, since there can be so many of them. Unless otherwise specified, it is assumed that there is a property or accessor (getter) and a mutator (setter) for every class attribute.
STEP 2: Create the Project
You will want to use the Week 4 project as the starting point for the lab. Use the directions from the iLab Assignment of Week 3 (Step 2) on how to create a new project and copy the files.
Before you move on to the next step, build and execute the Week 5 project.
STEP 3: Modify the Benefits Class
STEP 4: Modify the Employee Class
STEP 5: Create the Salaried Class
STEP 6: Create the Hourly Class
STEP 7: Construct the Main Method
STEP 8: Compile and Test
When done, compile and run your program.
Then debug any errors until your code is error-free.
Check your output to ensure that you have the desired output and modify your code as necessary and rebuild.
The output of your program should resemble the following:
Welcome the Employee Hierarchy Program
CIS247, Week 5 Lab
Name: Solution
This program tests an Employee inheritance hierarchy
*********************** Display Employee's Data **********************
Employee Type
GENERIC
First Name
Joe
Last Name
Doe
Gender
Male
Dependents
1
Annual Salary
$10,000.00
Weekly Pay
$192.31
Health Insurance
Partial
Life Insurance
$1,000.00
Vacation
2
*********************** Display Employee's Data **********************
Employee Type
SALARIED
First Name
Zoe
Last Name
Likoudis
Dependents
3
Management Lv1.
1
Annual Salary
$20,000.00
Weekly Pay
$423.08
Health Insurance
Full
Life Insurance
$2,000.00
Vacation
4
*********************** Display Employee's Data **********************
Employee Type
HOURLY
First Name
Kate
Last Name
Perry
Gender
Female
Dependents
0
Category
part time
Wage
$75.00
Hours
25
Weekly Pay
$1,875.00
Annual Salary
$97,500.00
Health Insurance
Partial
Life Insurance
$3,000.00
Vacation
8
total Number of Employess in Database: 3
Press the ESC key to close the image description and return to lecture
STEP 9: Submit Deliverables
Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this Dropbox Tutorial.
See Syllabus "Due Dates for Assignments & Exams" for due date information.
Explanation / Answer
#include #include #include #include using namespace std; const double MIN_SALARY = 50000; const double MAX_SALARY = 250000; const int MAX_DEPENDENTS = 10; const int MIN_DEPENDENTS = 0; const char DEFAULT_GENDER = 'N'; //N stands for not identified const int NUMBER_WEEKS = 52; const int MIN_MANAGEMENT_LEVEL = 0; const int MAX_MANAGEMENT_LEVEL = 3; const double BONUS_PERCENT= .10; const double MIN_WAGE = 10; const double MAX_WAGE = 75; const double MIN_HOURS = 0; const double MAX_HOURS = 50; class Benefit { private: string healthInsurance; double lifeInsurance; int vacation; public: Benefit() { healthInsurance = "not provided"; lifeInsurance = 0; vacation = 14; } Benefit(string healthInsurance, double lifeInsurance, int vacation) { healthInsurance = healthInsurance; lifeInsurance = lifeInsurance; vacation = vacation; } Benefit(Benefit &mybenefit) { this->healthInsurance = mybenefit.healthInsurance; this->lifeInsurance = mybenefit.lifeInsurance; this->vacation = mybenefit.vacation; } string getHealthInsurance() { return healthInsurance; } void setHealthInsurance(string healthInsurance) { this->healthInsurance = healthInsurance; } double getLifeInsurance() { return lifeInsurance; } void setLifeInsurance(double lifeInsurance) { this->lifeInsurance = lifeInsurance; } int getVacation() { return vacation; } void setVacation(int vacation) { this->vacation = vacation; } void displayBenefits() { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.