Question

1.) Write a code in Python to Calculate weekly pay with overtime for an hourly employee...

1.) Write a code in Python to Calculate weekly pay with overtime for an hourly employee (if number of hours exceed 40, then the hourly rate goes up by 50% of the usual hourly rate; the user will provide the hourly rate and the number of hours worked)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
hours = int(input("Enter total number of hours worked: "))
rate = float(input("Enter rate of pay per hour: "))

if hours > 40:
    regular_hours = 40
    overtime_hours = hours - 40
else:
    regular_hours = hours
    overtime_hours = 0

regular_pay = regular_hours * rate
overtime_pay = overtime_hours * rate * 1.5

print("Total pay is", regular_pay + overtime_pay)

Add a comment
Know the answer?
Add Answer to:
1.) Write a code in Python to Calculate weekly pay with overtime for an hourly employee...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Develop a WPF application that has a button to calculate an employee’s weekly pay, given the...

    Develop a WPF application that has a button to calculate an employee’s weekly pay, given the number of hours worked. An employee should have a first name, last name, age, and hourly consulting rate. You should be able to create an employee object and provide the hours worked to calculate the weekly pay. The application assumes a standard workweek of 40 hours. Any hours worked over 40 hours in a week are considered overtime and earn time and a half....

  • If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly...

    If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly pay) If the employee is not a supervisor and she worked 40 hours or less calculate her paycheck as her hourly wage * hours worked (regular pay) If the employee is not a supervisor and worked more than 40 hours calculate her paycheck as her (hourly wage * 40 ) + (1 ½ times here hourly wage * her hours worked over 40) (overtime...

  • A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who...

    A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and “time-and-a-half,” i.e. 1.5 times their hourly wage, for overtime hours worked), commission workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of money per item for each of the items they produce-each pieceworker in this company works on only one...

  • COMPUTING OVERTIME RATE OF PAY AND GROSS WEEKLY PAY Mike Fritz receives a regular salary of...

    COMPUTING OVERTIME RATE OF PAY AND GROSS WEEKLY PAY Mike Fritz receives a regular salary of $3,250 a month and is paid 1½ times the regular hourly rate for hours worked in excess of 40 week. per (a) Calculate Fritz's overtime rate of pay. (Compute to the nearest half cent.) (b) Calculate Fritz's total gross weekly pay if he works 46 hours during the week.

  • An hourly employee is paid $30/hour for a 40 hour week. Overtime is paid at time-and-a-half...

    An hourly employee is paid $30/hour for a 40 hour week. Overtime is paid at time-and-a-half for hours worked in excess of 40 hours. In the prior week, the employee worked 48 hours. Federal income taxes of $250 were withheld, and state income taxes of $40 were withheld. FICA taxes of 6.2% (Social Security) and 1.45% (Medicare) were also withheld. What is the weekly gross pay amount or this employee? What is the weekly net pay amount for this employee?

  • Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The...

    Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...

  • Design an algorithm to calculate the weekly pay for employees. The user will prompted to enter...

    Design an algorithm to calculate the weekly pay for employees. The user will prompted to enter the number of hours worked and their job code. Hours in excess of 40 are paid at 1.5 times the hourly pay. Job code hourly rates are: P - $10, Q - $12.50, R - $15.00, and S - $20.00. Use both a case and a selection structure.

  • Program Description: Write the pseudocode for a program that will calculate and display an employee’s gross...

    Program Description: Write the pseudocode for a program that will calculate and display an employee’s gross pay. Input the number of hours an employee worked for each of the 5 days of the week. Add them all up to get his hours worked for the week. Weekly Pay is calculated by adding an employee’s normal pay plus any overtime pay. Normal hours are paid at $10/hr. Any over time is paid at $15/hr. Any hours over 40 are considered overtime....

  • use at least two functions in your program. . Write a program that calculates weekly payment....

    use at least two functions in your program. . Write a program that calculates weekly payment. The program will ask the user full name, ID number (make one up), and hours worked. An hourly worker’s gross pay is basically his/her work hours that week multiplied by his/her regular hourly pay rate. However, after the first 40 work hours of the week, each additional work hour is paid at an overtime rate that is 1.5 times of the regular hourly rate....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT