Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

OUTPUT: - The bold text is the user's input. Please enter number of hours worked for this week: 40 What is hourly rate? 10 Your pay for this week is: $400.0 Do you want another pay calculation? (y or n) y Please enter number of hours worked for this week: kk You entered wrong information for number of hours. Please enter number of hours worked for this week: 60 What is hourly rate? kk You entered improper information for the rate. What is hourly rate? 10 Your pay for this week is: $700.0 Do you want another pay calculation? (y or n) y Please enter number of hours worked for this week: 70 What is hourly rate? 10 Your pay for this week is: $900.0 Do you want another pay calculation? (y or n) n Good bye

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions