Answer:
Written in Python:
rate = float(input("Hourly Rate: "))
hours = int(input("Work Hours: "))
if hours>40:
salary = 40 * rate + (hours - 40) * 1.5 * rate
else:
salary = rate * hours
#Remove Income Tax
afterincometax = salary - 0.25 * salary
#Determine Total Pay
if rate > 50:
totalpay = afterincometax - 100
else:
totalpay = afterincometax - 50
print("Total Pay: "+str(totalpay))
Step-by-step explanation:
This line gets hourly rate
rate = float(input("Hourly Rate: "))
This line gets work hours
hours = int(input("Work Hours: "))
The following if statement calculates salary
if hours>40:
salary = 40 * rate + (hours - 40) * 1.5 * rate -----If hours > 40, overtime is considered
else:
salary = rate * hours -----If otherwise, overtime is not considered
#Remove Income Tax
This line removes 25% income tax from the salary
afterincometax = salary - 0.25 * salary
#Determine Total Pay
The following if statement removes union dues.
if rate > 50:
totalpay = afterincometax - 100
else:
totalpay = afterincometax - 50
This line prints the totalpay
print("Total Pay: "+str(totalpay))