Hi I am in a web programming class and have been struggling greatly with this assignment. I am not very familiar with Functions and so forth but I have been truthfully working on this for a few days now. I am at the point where I am stuck. I would appreciate it if any of you guys or gals could help me out. Thanks again.
def employee(): global eName global pRate global hWork def Lowest(hoursList): PAYList.sort() lowestPay = hoursList return lowestPay def Highest(hoursList): hoursList.sort() highestPay=hoursList[len(hoursList)-1] return highestPay def Average(hoursList): total=0 for hour in hoursList: total += hour avgPay = total / len(hoursList) return avgPay raw_input("Hit ENTER to start Payroll Program.") hours= hWork="1" while True: eName=raw_input("\nPlease enter the employees' first and last name. ") hWork=raw_input("How many hours did they work this week? ") if hWork < "1" or hWork > "60": print "Employees' can't work less than 1 hour or more than 60 hours!" continue else: pRate=int(raw_input("What is their hourly rate? ")) if pRate < 6 or pRate > 20: print "Employees' wages can't be lower than $6.00 or greater than $20.00!" else: ## eName.append(name.title() + "\n") hours.append(hWork + "\n") ePass = "" ePass = raw_input("Type DONE when finished with employees' information. ") if ePass == "DONE": try: hoursFile=open("PAY.txt", "w") hoursFile.writelines(hours) ## hoursFile.writelines(eName) hoursFile.close() except(IOError): print "Error writing hours! " quit() try: hoursFile=open("PAY.txt", "r") hoursList=hoursFile.readlines() hoursFile.close() hoursList.sort() except(IOError): print "Error writing names! " quit() modHours = hoursList for hour in hoursList: print hour
Edited 6 Years Ago by henryford: n/a