Question: Create a Python script file called Assignment _ Ch 0 5 - 1 _ yourLastName.py . ( Replace yourLastName with your last name. ) Write

Create a Python script file called Assignment_Ch05-1_yourLastName.py.(Replace yourLastName with your last name.)
Write a Python program prompts the user to input number of hours worked, hourly rate and output pay amount. If hours worked is over 40 hours, calculate overtime pay (1.5 times of hourly rate). If hours worked is over 60 hours, calculate double overtime pay (2 times of hourly rate). Also, if user enters wrong input (entering characters, negative numbers, etc.) your program needs to display message informing user of wrong input.Once error message gets displayed, you need to ask user to provide proper inputs again. Hourly rate and number of hours worked can be integers or floating point numbers.
For this assignment, you need to utilize the function to carry out calculation of the pay. Create a function called CalPay (hrs, rate) which will take two arguments and return pay amount. Also, after displaying pay amount, your program needs to ask user whether user wants to repeat it or not. If user wants to repeat, your program has to start same procedure by utilizing loop. For this assignment, use "while" loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!