Question
C++ Program Using Visual Studio Program Requirements: Create a class (named Employee). Each employee will have four data members: (i) Name of string type, (ii)
C++ Program Using Visual Studio
Program Requirements:
Create a class (named Employee). Each employee will have four data members: (i) Name of string type, (ii) Emp_ID (Employee ID) of integer type, (iii) Salary (annual salary) of Integer type, (iv) Retirement_cont (Annual Retirement Contribution) of double type. The member data members should be private.
It will have the following public member functions:
Constructor with following parameters: A pointer to a string to initialize the Name of the employee Integer to initialize the Emp_ID Integer to initialize Salary
The Retirement_cont will be initialized as 6% of the Salary
DisplayEmp: Output the Name, Employee ID, Salary and Retirement Contributions in separate lines Output monthly gross salary of the employee by dividing Salary by 12 Output net Salary of the employee by subtracting retirement contribution from gross salary
GetSalary: Returns the Salary of the Employee
GetRet: Returns the Retirement contribution of the Employee
Test your class by creating five different employee objects for a small business in the main function.
Output Total Salary and Retirement contributions of the Employees.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started