Question
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
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.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started