Answer:
rate = 100
hours_worked = eval(input('enter number of hours worked'))
gross_pay = hours_worked * rate
if hours_worked <= 40 :
print(gross_pay)
else:
print(gross_pay + (1.5*rate*(hours_worked -40)))
Explanation:
Using python 3 :
The rate of pay is defined using the rate variable
The user is the prompted to enter the number of hours worked.
Gross_pay gives the mathematical evaluation of the amount paid base in rate and hours worked.
Since hours beyond 40 are paid as overtime. Then we have to add that to those who worked above 40 hours.
If hours_worked is 40 and below, then use gross pay
If gross pay is above 40 ; then the overtime fee is added to gross pay using the rate provided.