Wage = float(input("How much do you make per hour?\n")) God I wish I could copy code with the whitespace indent. I also had to change the line: "if hours > 40" to "if hours 40: ![]() But with the break in place, it exits out of the loop after printing "end report". Without the break, it just continues the loop after the "end report". I then left the print, but added a break. This checks the input "user" and if its = to 0, it runs the next line. Then I slightly changed the first line in the while loop so it says: if user = "0": So rather than it being: end = "0", I set it to: end = False, the while loop then runs whilst "end = False". Let me explain my changes so if this helps you know why it works.įirst off I changed the method of defining when to end. I have copied most of your code and it all works well. ![]() Please enter your name or type '0' to quit: 0 Please enter your name or type '0' to quit: Brandon This is how it shows up when you run it: One Stop Shop Payroll Calculator Grosspay = round(regularpay+overtimepay,2) Overtimepay = round(overtimehours * overtimerate) Payrate =(float(input("Please enter your payrate: $", ))) Hours = (float(input("Please enter hours worked: ", ))) User = input("Please enter your name or type '0' to quit: ") Print("One Stop Shop Payroll Calculator") One Stop Shop Payroll Calculator user = str I can't figure out how to get it to stop printing the payroll information after you end it. ![]() whenever I enter "0" at the start the program closes as it should, but if I enter it after calculating a users pay it prints (end of report and the previous payroll information). The user input starts by asking for your name or "0" to quit the program. I'm writing a payroll calculator for school in python 3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |