Intro to Python-Lab 4-INT-2240
Intro to Python-Lab 4
- Chris owns an auto repair business and has several employees. If any employee works over
40 hours in a week, he pays them 1.5 times their regular hourly pay rate for all hours over
- He has asked you to design a simple payroll program that calculates an employee’s
gross pay, including any overtime wages. You design the following algorithm:
Get the number of hours worked.
Get the hourly pay rate.
If the employee worked more than 40 hours:
Calculate and display the gross pay with overtime.
Else:
Calculate and display the gross pay as usual.
create the hierarchy chart, there are three functions,
summarized as follows:
- main—This function will be called when the program starts. It will get the number of
hours worked and the hourly pay rate as input from the user. It will then call either
the calc_pay_with_OT function or the calc_regular_pay function to calculate and
display the gross pay.
- calc_pay_with_OT—This function will calculate and display an employee’s pay with
overtime.
- calc_regular_pay—This function will calculate and display the gross pay for an
employee with no overtime
Answer Preview-Intro to Python-Lab 4-INT-2240
$3.00