Employee Benefit

Download Category:

Employee_Benefit.zip - (639.91 KB)
[
Employee_Benefit/Benefit.cpp
Employee_Benefit/Benefit.h
Employee_Benefit/Debug/
Employee_Benefit/Debug/Benefit.obj
Employee_Benefit/Debug/cl.command.1.tlog
Employee_Benefit/Debug/CL.read.1.tlog
Employee_Benefit/Debug/CL.write.1.tlog
Employee_Benefit/Debug/Employee.exe
Employee_Benefit/Debug/Employee.exe.embed.manifest
Employee_Benefit/Debug/Employee.exe.embed.manifest.res
Employee_Benefit/Debug/Employee.exe.intermediate.manifest
Employee_Benefit/Debug/Employee.ilk
Employee_Benefit/Debug/Employee.lastbuildstate
Employee_Benefit/Debug/Employee.log
Employee_Benefit/Debug/Employee.obj
Employee_Benefit/Debug/Employee.pdb
Employee_Benefit/Debug/Employee.vcxprojResolveAssemblyReference.cache
Employee_Benefit/Debug/Employee.write.1.tlog
Employee_Benefit/Debug/Employee_manifest.rc
Employee_Benefit/Debug/link.9472.read.1.tlog
Employee_Benefit/Debug/link.9472.write.1.tlog
Employee_Benefit/Debug/link.9472-cvtres.read.1.tlog
Employee_Benefit/Debug/link.9472-cvtres.write.1.tlog
Employee_Benefit/Debug/link.command.1.tlog
Employee_Benefit/Debug/link.read.1.tlog
Employee_Benefit/Debug/link.write.1.tlog
Employee_Benefit/Debug/link-cvtres.read.1.tlog
Employee_Benefit/Debug/link-cvtres.write.1.tlog
Employee_Benefit/Debug/Main.obj
Employee_Benefit/Debug/mt.command.1.tlog
Employee_Benefit/Debug/mt.read.1.tlog
Employee_Benefit/Debug/mt.write.1.tlog
Employee_Benefit/Debug/rc.command.1.tlog
Employee_Benefit/Debug/rc.read.1.tlog
Employee_Benefit/Debug/rc.write.1.tlog
Employee_Benefit/Debug/stdafx.obj
Employee_Benefit/Debug/vc100.idb
Employee_Benefit/Debug/vc100.pdb
Employee_Benefit/Employee.cpp
Employee_Benefit/Employee.h
Employee_Benefit/Employee.sln
Employee_Benefit/Employee.suo
Employee_Benefit/Employee.vcxproj
Employee_Benefit/Employee.vcxproj.filters
Employee_Benefit/Employee.vcxproj.user
Employee_Benefit/Main.cpp
Employee_Benefit/Question.txt
Employee_Benefit/Screenshot_1.jpg
Employee_Benefit/stdafx.cpp
Employee_Benefit/stdafx.h
Employee_Benefit/targetver.h
]

On microsoft visual studio C++
The only change to the Employee class is that there is a new attribute:
+benefit : Benefit
Notice that there is a “+” for this attribute, meaning that it is public. Make sure to examine the multi-arg constructor’s signature!
Also, the dotted directed line between Employee and iEmployee specifies that the Employee class must implement the iEmployee abstract class, and thus provide an implementation for the calculatePay method.The only change to the Employee class is that there is a new attribute:
+benefit : Benefit
Notice that there is a “+” for this attribute, meaning that it is public. Make sure to examine the multi-arg constructor’s signature!
Also, the dotted directed line between Employee and iEmployee specifies that the Employee class must implement the iEmployee abstract class, and thus provide an implementation for the calculatePay method.

Using the UML Diagrams from

Step 1, create the Benefit class. To get an idea of how to format displayBenefits, take a look at the output in Step 5.
Add a Benefit attribute to the Employee class.
Initialize the new Benefit attribute in both Employee constructors. Again, take note of the multi-arg constructors parameter list!
Create the iEmployee interface (abstract class in C++).
Modify the Employee class to implement the new interface so that Employee will have to implement the calculatePay method.
Modify the Employee class to call displayBenefit when displaying Employee information.
Notice that the Employee class now has a public benefit object inside it. This means that you can access the set methods of the Benefit object with the following code:
.benefit.
As an example, to set the lifeInsurance attribute inside an Employee object called emp, we could execute the following code:
emp.benefit.setLifeInsurance(lifeInsurance);
The steps required to modify the Main class are below. New steps are in bold.
Create an Employee object using the default constructor.
Prompt for and then set the first name, last name, and gender. Consider using your getInput method from Week 1 to obtain data from the user for this step as well as Step 3.
Prompt for and then set the dependents and annual salary using the overloaded setters that accept Strings.
Prompt for and set healthInsurance, lifeInsurance, and vacation.
Using your code from Week 1, display a divider that contains the string “Employee Information”.
Display the Employee Information.
Display the number of employees created using getNumEmployees(). Remember to access getNumEmployees using the class name, not the Employee object.
Create a Benefit object called benefit1 using the multi-arg construction. Use any information you want for health insurance, life insurance, and vacation.
Create another Employee object and use the constructor to fill it with the following:
“Mary”, “Noia”, ‘F’, 5, 24000.0, benefit1
Using your code from Week 1, display a divider that contains the string “Employee Information”.
Display the employee information.
Display the number of employees created usinusing getNumEmployees(). Remember to access getNumEmployees using the class name, not the Employee object.

Write a Review

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.