Question

Python Coding Federal law requires that hourly employees be paid “time and a half” for all...

Python Coding

Federal law requires that hourly employees be paid “time and a half” for all work above 40 hours per week. Write a program that prompts the user to enter their hours worked and hourly wage (e.g. $20.00/hr) and then computes and prints their pay. The program should test the number of hours worked to determine if any overtime pay is due.

As an example for regular pay (no overtime) suppose that a worker makes $10/hr and works 40 hours in a week. His pay would be: 40 hours times $10.00 or $400.00. Another employee who worked 50 hours would have 10 hours of overtime pay added. That employee’s pay would be computed as: 40 hours times $10.00 for $400 for the first 40 hours PLUS 10 hours times $10.00/hr times 1.5 for another $150. The total then would be $550.00.

Test the program for the following salary and hours worked:   
Salary Hours Answer
25 40 $1,000
20 55 $1,250
23 30 $690

Homework Answers

Answer #1
hours = float(input("Enter number of hours: "))
pay = float(input("Enter hourly pay: "))
salary=0
if(hours>40):
        salary = pay * 40
        salary = salary+((hours-40)*pay*1.5)
else:
        salary=hours * pay

print("Salary\tHours\tPay")
print(pay,"\t",hours,"\t",salary)

NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.

I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME IT IS VERY IMP FOR ME

Know the answer?
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
Similar Questions
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate...
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate hourly rates and overtime rates as follows: 1. Carry the hourly rate and the overtime rate to 3 decimal places and then round off to 2 decimal places (round the hourly rate to 2 decimal places before multiplying by one and one-half to determine the overtime rate). 2. If the third decimal place is 5 or more, round to the next higher cent. 3....
Chapter 10 - 4 Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer,...
Chapter 10 - 4 Calculate Payroll K. Mello Company has three employees-a consultant, a computer programmer, and an administrator. The following payroll information is available for each employee: Consultant Computer Programmer Administrator Regular earnings rate $3,210 per week $34 per hour $40 per hour Overtime earnings rate Not applicable 2 times hourly rate 1.5 times hourly rate Federal income tax withheld $920 $244 $510 For hourly employees, overtime is paid for hours worked in excess of 40 hours per week....
Franklin Industries pays employees 10% of their hourly rate as a premium for working the evening...
Franklin Industries pays employees 10% of their hourly rate as a premium for working the evening shift. Ray’s regular hourly rate is $12.25; this week he worked 40 hours on the evening shift. Calculate shift premium paid to employees.   Jupiter Textiles, located in BC , makes a bi weekly salary payment of $ 2,150 and an overtime payment of $200 to David on the same cheque. Calculate David’s gross insurable income and EI per pay period. Complete the following table...
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate...
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate hourly rates and overtime rates as follows: 1. Carry the hourly rate and the overtime rate to 3 decimal places and then round off to 2 decimal places (round the hourly rate to 2 decimal places before multiplying by one and one-half to determine the overtime rate). 2. If the third decimal place is 5 or more, round to the next higher cent. 3....
17. Martin Jackson receives an hourly wage rate of $23, with time-and-a-half pay for all hours...
17. Martin Jackson receives an hourly wage rate of $23, with time-and-a-half pay for all hours worked in excess of 40 hours during a week. Payroll data for the current week are as follows: hours worked, 45; federal income tax withheld, $207; social security tax rate, 6.0%; and Medicare tax rate, 1.5%. What is the net amount to be paid to Jackson, rounded to the nearest cent? a.$803.56 b.$1,092.50 c.$1,470.56 d.$1,781.06 20. The independent auditor's report a.describes which financial statements...
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate...
Note: In this chapter and in all succeeding work throughout the course, unless instructed otherwise, calculate hourly rates and overtime rates as follows: 1. Carry the hourly rate and the overtime rate to 3 decimal places and then round off to 2 decimal places (round the hourly rate to 2 decimal places before multiplying by one and one-half to determine the over-time rate). 2. If the third decimal place is 5 or more, round to the next higher cent. 3....
Prepare a worksheet that allows the user to enter ONLY these fields: Start Time and End Time per day...
Prepare a worksheet that allows the user to enter ONLY these fields: Start Time and End Time per day on a 5 day workweek (10 cells) and Hourly Wage (1 cell), Total Hours Worked (1 cell), and Total Earnings (1 cell). So there should ONLY be 13 data entry fields for the user.  Each of those fields should have a title, so there should be an additional 13 title cells explaining each data cell. Make sure that the title fields are properly labeled. So, there should be 26 cells used in total.  The user will...
Kipley Company is a small manufacturing firm located in Pittsburgh, Pennsylvania. The company has a workforce...
Kipley Company is a small manufacturing firm located in Pittsburgh, Pennsylvania. The company has a workforce of both hourly and salaried employees. Each employee is paid for hours actually worked during each week, with the time worked being recorded in quarter-hour increments. The standard workweek consists of 40 hours, with all employees being paid time and one-half for any hours worked beyond the 40 regular hours. Wages are paid every Friday, with one week's pay being held back by the...
In preparing for next year, on December 1 Tony Freedman hired two hourly employees to assist...
In preparing for next year, on December 1 Tony Freedman hired two hourly employees to assist with some troubleshooting and repair work. a. Prepare a payroll register for the three pay periods. b. Record the following transactions in the general journal and post them to the general ledger. Assume the following transactions: Dec. 7 Paid employee wages: Lance Kumm, 38 hours, and Anthony Hall, 42 hours. Dec. 14 Paid employee wages: Lance Kumm, 25 hours, and Anthony Hall, 36 hours....
Prevosti Farms and Sugarhouse pays its employees according to their job classification. The following employees make...
Prevosti Farms and Sugarhouse pays its employees according to their job classification. The following employees make up Sugarhouse's staff: Employee Number Name and Address Payroll information A-Mille Thomas Millen Hire Date: 2-1-2019 1022 Forest School Rd DOB: 12-16-1982 Woodstock, VT 05001 Position: Production Manager 802-478-5055 PT/FT: FT, exempt SSN: 031-11-3456 No. of Exemptions: 4 401(k) deduction: 3% M/S: M Pay Rate: $35,000/year A-Towle Avery Towle Hire Date: 2-1-2019 4011 Route 100 DOB: 7-14-1991 Plymouth, VT 05102 Position: Production Worker 802-967-5873...