Program three
Write a program that given the number of hours worked, calculates the
gross and net pay for that period.
- Input to your program
- You should prompt the user for the following values
- Hours worked - an integer
- This should be positive and greater than 40.
- Hourly rate - a floating point number
- This should be positive and greater than 0.
- First Name - a string
- Last Name - a string
- You may assume that the input is correct and in the correct
format
- Calculations
- You should calculate gross pay
- Gross PAY = regular pay + overtime pay
- regular pay = hours * hourly rate
- overtime pay = hours over 40 * 1.5 * hourly rate
- You should calculated adjusted gross pay
- adjusted gross pay = gross pay - tax free deductions
- Use the folowing nontaxable deductions
- United Way $10
- 401K $123.45
- Medical Deduction 0.5%
- You should calculate taxes withheld
- tax = adjusted gross pay * taxrate
- Calculate the folowing taxes
- Federal Rate 10 %
- State Rate 5 %
- Local Rate 1 %
- You should calculate total taxable deductions
- Take the folowing taxable deductions
- Parking $7.43
- Union Dues $3.45
- Finally, you should calculate net pay
- net pay = gross pay - nontaxable deductions - taxes withheld - taxable deductions
- Output
- You shoud print all dollar amounts to two decimal points
- You should produce the folowing report:
Pay Report _LASTNAME_,_FIRSTNAME_
Hours Worked ##
Overtime Hours ##
Overtime Pay $####.##
Gross Pay $####.##
Non-Taxable Deductions
United Way $###.##
401K $###.##
Medical $###.##
-------
Total $###.##
Taxes
Adjusted Gross $####.##
Federal $####.##
State $####.##
Local $####.##
--------
Total Taxes $####.##
Other Deductions
Parking $##.##
Union Dues $##.##
------
Total $##.##
Net Pay $####.##
When the program is complete, please send a copy to dbennett@edinboro.edu,
the subject of your message should be program3, csci 130
This program is due Friday, October 26 at 11:59 pm.
This program is worth 10 points.