Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Enter hours worked: 40 Enter basic pay rate: 10.5 40 at $10.5 per hour; total pay $420.0 Enter hours worked: 40 Enter basic pay rate:

Enter hours worked: 40 Enter basic pay rate: 10.5 40 at $10.5 per hour; total pay $420.0 Enter hours worked: 40 Enter basic pay rate: 10.5 40 hours at $10.5 per hour; total pay $420.0 Enter hours worked: 30 Enter basic pay rate: 9.5 30 hours at $9.5 per hour; total pay $285.0 The program first prompts for the total number of hours (an integer) worked by the employee. If the number of hours worked is more than 80, the program displays Invalid input In this case (more than 80 hours of work), the program would do nothing more. Otherwise, it proceeds to Step 3 3. It then asks for the pay rate for the employee. This is a float. This value is the basic pay rate for working up to and including 40 hours. 4. If and only if the number of hours worked is more than 40, the program prompts for and reads in the overtime pay rate, which applies for all hours worked above 40 5. The program displays the values read in and the breakup of the computation (for hours up to 40 and for any hours above 40), and the total pay. (See the examples for the expected format to display the result for the various situations.) The program must not prompt for anything that is not called for by the above or the interactions given later Make sure that the program prompts for the input and displays the result as given in the following examples. Debug your code as necessary until it complies with all requirements. The Python code should prompt for user input and display results as given in the six sample interactions below There are six invocations of the program, and they are separated by blank lines. Study the examples carefully to understand the expected behavior and the pay computation process. Enter hours worked Invalid input Enter hours worked: 80 Enter basic pay rate: 12.5 Enter overtime pay rate: 20 First 40 hours at $12.5 per hour and next 40 hours at $20.0 per hour; total pay $1300.0 Enter hours worked: 60 Enter basic pay rate: 10.5 Enter overtime pay rate: 16.5 First 40 hours at $10.5 per hour and next 20 hours at $16.5 per hour; total pay $750.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

What is the difference between crystallization and desublimation?

Answered: 1 week ago

Question

=+b) Find the predicted value for the year 2012. Is it realistic?

Answered: 1 week ago