Question: BY USING C++ Create an Employee class (using specification and implementation files) that includes three private attributes - a first name of type string, a

 BY USING C++ Create an Employee class (using specification and implementation

BY USING C++

Create an Employee class (using specification and implementation files) that includes three private attributes - a first name of type string, a last name of type string and a monthly salary of type double. The class should have a constructor that initializes the three private attributes. Additionally, provide a set and a get method for each attribute. The set method for the salary attribute must guard against negative input values. Write a test program that demonstrates the class Employee's capabilities by first creating two Employee objects. Then, display each employee's first and last name, as well as the employee's yearly salary. Finally, give each employee a 10 percent (monthly) raise and again display each employee's yearly salary. Some examples of utilizing the class Employee (in the main() function): //Create two employees Employee el("John", "Doe", 12345.67): Employee e2("Jane", "Jones", 76543.21): //Display employees' info //Give raise //Display yearly salary //Change Jane's last name to "Doe" //Display Jane's info Create a zip file of all your source files using the filename A1_yourLastname. Then, upload the zip file in the Assignment Section of the website

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!