You are working for a company that is somewhat progressive in their pay scale. Single people get paid $10 per hour; married people get paid $15 per hour. In either case, they get paid an extra $1 per hour for their first four children.
Your program in Python will deduct income tax according for the following income tax brackets:
Weekly income | Income Tax Rate |
---|---|
Under $300 | No Tax |
$300 - $399.99 | 5% |
$400 - $599.99 | 8% |
$600+ | 10% |
Divide the program into several functions:
printInstructions()
- prints instructions
on how to use the program.getMaritalStatus()
- which returns true if
the employee is married, false if not. Remember to have it return a boolean.getNumKids()
- which returns the number of
children that the employee has.getHours()
- which returns hours worked.calcGrossPay(payRate, hoursWorked)
- which
returns the gross pay.calcNetPay(grossPay)
- which returns the net
pay.printStub(payRate, hoursWorked, numKids, grossPay, netPay)
- which prints your pay stub (payroll information).Ask the user if (s)he wants the instructions displayed. Obviously, the printInstructions method is only used if the answer is 'y' or 'Y'.
As usual, the employee will get time and a half after 40 hours.