Program
31
C++
K.
Dzwonkiewicz
PAYROLL
Calculate a payroll for a
company. The process is simple…get the
employee’s name, hours worked, pay rate and union status. This info is all in a data file called
pay.dat. The pay is calculated in the
normal way…
v If hours <=40 then gross is rate x hours
v If hours exceeds 40 you must calculate
overtime pay as
40 x rate + (hours –40) x 1.5 rate
v Taxes are 33 1/3 % of gross
v Union dues are $10.00 (fixed)
I have it on disk when you need to get your
program checked. You must make your own
to de-bug you program.
In the file the information is stored like this…
Dzwonkiewicz,
Konrad
40 12.55 y
Gates, Bill
52 255.67 n
Zonzic, Alexander
25 8.50 y
Print out this chart…
Name Rate Hours Taxes Union Net Pay
Gates, Bill $255.67 52 $4942.95 $ 0.00 $9885.91
Dzwonkiewicz, Kon $ 12.55 40 $ 167.33 $10.00 $ 324.67
TOTALS:
EMPLOYEES PROCESSED: 2
TOTAL HOURS: 92
TOTAL TAXES: $5110.28
TOTAL UNION DUES: $10.00 (1 employee)
TOTAL NET PAY: $10210.58