Question
C++ Employee Class CS 1410 Beginning the Employee Series Project Background This program is the first of a series of three programs that will you
C++ Employee Class
CS 1410 Beginning the Employee Series Project
Background
This program is the first of a series of three programs that will you will do over the course of the semester that deal with a payroll application. When you are done with this project, be sure to put it in a safe place because you will use it later. Modern software development is very much an incremental and iterative process. Programs are developed a piece at a time as their developers iterate on the design, refactor existing code, and add new function. This set of exercises will give you a glimpse into that process. In this first program you will develop an Employee class and test it with a simple driver program. This project is all about properly designing and coding a program that uses a class of your own design and that is easy to modify.
Objectives:
1. Refine your object oriented design skills.
2. Give you practice drawing a class diagram.
3. Create the proper structure and code for a C++ program containing a class of your design.
4. Create a driver program to test your class.
The Employee Class
For this project you need to design an Employee class. Your Employee class should have the following data members:
employeeNumber (integer)
name (string)
street address (string)
phone number (string)
hourly wage (double)
hours worked this week (double)
Your Employee class will have the following functions:
A constructor for the Employee class that takes arguments to initialize all of the above mentioned data members.
Getters for each attribute of your class.
Setters that follow encapsulation principles for each class attributes except the employee number which never changes.
A function, calcPay( ) that calculates and returns an employee's net pay. An employee's gross pay is calculated by multiplying the hours worked by their hourly wage. Be sure to give time-and-a-half for overtime (anything over 40 hours). To compute the net pay, deduct 20% of the gross for Federal income tax, and 7.5% of the gross for state income tax.
Before you write any code, create a class diagram for this class. You will include your class diagram when you submit this assignment.
The Driver
The major function of the driver is to test your Employee class. By no means is it a complete, polished application. Such a driver is common when doing iterative development. In this project, you will create a .cpp file that contains your driver code and a stand-alone printCheck( ) function.
The printCheck( ) function is not a member of any class. It will output the employee's name, the employee's net pay for this pay period, the hours worked by the employee, and their hourly wage. The function should output these in a rough simulation of a paycheck and paystub, as illustrated in the sample output below.
Your driver will contain a main( ) function that does the following. You may use this description as your pseudo-code:
1. Create an Employee object for an employee whose hourly wage is $10.00, and who has worked 45 hours. Use your imagination to come up with your employee's name and other employee information.
2. Create a second employee object for an employee whose hourly wage is $12.50 and who has worked 30 hours.
3. Call your printCheck( ) function, passing the first Employee object as the argument.
Submitting Your Assignment
After you are satisfied that your program works correctly, submit it to Canvas in accordance with course standards. Note check to make sure you included:
1. The source code for your driver.
2. The source code for the Employee .h and .cpp files.
3. A screen shot of your execution results.
4. A class diagram pdf.
CM Users 10002705 DesktopWcode projo4Debuglproj04.exe Fluff Shuffle Electronics Pay to the order of Joe Brown $344.38 United Bank of Eastern orem Hours worked 45.00 Hourly Wage 10.00 Press any key to continueStep 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