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...

  • write the code in python programming that will read in the following from the user. Hourly...

    write the code in python programming that will read in the following from the user. Hourly Pay Rate, Hours Worked. if both values read in are positive, calculate the net pay. To calculate the net pay, first calculate the gross pay.the gross pay is the hours worked times the hourly rate. Next calculate the taxes. tax the first$300 dollars at 15% tax the next $150 at 20% tax the rest at 25% the net pay is equal to the gross...

  • 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.

  • 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...

  • 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?

  • An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular...

    An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a program that takes as input the hourly wage, total regular hours, and total overtime hours and displays an employee’s total weekly pay. Please use else statements and python as your application.

  • 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.

  • 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...

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