CMPS 1043 - Program #2 – Employee Payroll - Fall...

advertisement
CMPS 1043 - Program #2 – Employee Payroll - Fall 2011
DUE: Monday, Sept. 26//Tuesday, Sept. 27
Problem Solving Steps DUE: Wed., Sept. 21//Thurs., Sept. 22
Implement the payroll program using file input and file output. Use a while loop (as in programs
#1) to process the payroll for 10 different employees. For each employee enter the employee’s
id number, number of hours worked, and hourly pay rate.
Calculate the gross pay. (All hours are paid at the hourly rate, no extra for overtime.) Then
compute the following deductions and the final net pay based on the following percentages of
the gross pay or the flat rate.
 Income Tax is 15% (of gross pay)
 FICA is 8.25%
 Payroll Savings is 5%
 Retirement is 5%
 Health Insurance is $ 50.00
Create a data file of the following data: (IdNumber, Hours, HourlyPay)
4218
40
12.93
5478
30
48.25
6723
50
20.79
1234
12.5
9.56
3567
15.6
15.99
7878
47.3
25.00
5633
13.9
7.75
4590
60
15.50
8998
18.9
9.00
4331
45.21
28.99
Output is to be in exactly the following form. Insert correct information in place of
parentheses. Print your name only once. Draw a line between each employee’s information.
The x’s represent where your answers will be placed. Must use I/O manipulators.
Student Name: (Your name)
Employee: (id number)
Gross Pay
Federal Income Tax
FICA
Payroll Savings
Retirement
Health Insurance
$ xxxxx.xx
$ xxxxx.xx
$ xxxxx.xx
$ xxxxx.xx
$ xxxxx.xx
$ xxxxx.xx
Net Pay
$ xxxxx.xx
* ** Repeat this part
10 times, once
for each employee.
Other notes:
* I recommend that you get the program running using cin/cout statements then change or add
the file I/O once it is working properly.
* Check several of your data items by hand to make sure your answers are correct.
* Double check you data input file to make sure there are no typing errors.
* Turn in your program listing, the listing of your output file, and the listing of your input file.
* Use type double for all your numeric variables.
* Watch carefully for errors due to mixed type arithmetic.
* Double check your alignment & spacing (I/O Manipulators)
Download