I need to have 3 functions in addition to the main. I got a response before except it didn't have 3 functions. The 1st function asks the user how many hours were worked and the pay rate and returns this information to main. The second function calculates the regular hours and overtime hours and returns this information to main. The third function calculates the regular pay, (regular hours times pay rate); overtime pay, (overtime hours times 1.5 pay rate) and the total pay and returns this information to main. I've been working on this for a couple weeks but can't figure out how to set up the 3rd function and return it to the main. Please help. I have errors in lines 65, 41, 27.
def ask_hours():
hours = float(raw_input ("How many hours did you work? "))
rate = float(input ("What is your rate of pay? "))
return hours, rate
def findrate(hours, rate):
if hours >= 40:
hours1 = 40
ot = hours - 40
elif hours < 40:
hours2 = hours
ot1 = 0
return hours1, ot, hours2, ot1
def getpaid(pay):
if hours1 >= 40:
pay = hours1 * rate
ot3 = ot * 1.5
elif hours1 < 40:
pay = hours * rate
ot3 = 0
return pay, ot3
def main() :
hours, rate = ask_hours()
findrate(hours, rate)
getpaid(pay)
print "Pay rate", rate
if hours >= 40:
print "Regular hours", hours
print "Overtime hours", ot
elif hours < 40:
print "Regular hours", hours2
print "Overtime hours", 0
if hours >= 40:
print "Regular pay", (40 * rate)
elif hours < 40:
print "Regular pay", (hours * rate)
if hours >= 40:
print "Overtime Pay", ot3
elif hours < 40:
print "Overtime Pay", 0
if hours >= 40:
print "Total Pay", (pay + ot3)
elif hours < 40:
print "Total Pay", (pay + 0)
main()