#Payroll Program #Robert Layton MIN_RATE = 7.50 MAX_RATE = 18.25 MIN_HOURS = 0 MAX_HOURS = 40 #GET PAY RATE payrate = input("\nEnter the employee's hourly pay rate: ") while(payrate < MIN_RATE or payrate > MAX_RATE): print("\nThe entered pay rate is invalid.") payrate = input("\nEnter the employee's hourly pay rate: ") # GET HOURS WORKED hours = input("\nEnter the employee's hours worked: ") while(hours < MIN_HOURS or hours > MAX_HOURS): print("\nThe entered number of hours is invalid.") hours = input("\nEnter the employee's hours worked: ") #DISPLAY GROSS PAY BASED ON VALID DATA print '\nThe gross pay for this employee is', payrate*hours
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question