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
Hourly workers are paid at their regular pay rate for their first 40 hours worked each...
Hourly workers are paid at their regular pay rate for their first 40 hours worked each week. Any hours beyond that are considered overtime, and they get paid "time-and-a-half" for those hours (1-1/2 times their regular pay rate). For example, if a worker normally makes $12.00 per hour and has worked 45 hours in the past week, the pay is computed as follows: 40 times $12 for the "regular" hours is $480. The extra 5 hours is overtime and is...
In each of the projects that follow, you should write a program that contains an introductory...
In each of the projects that follow, you should write a program that contains an introductory docstring. This documentation should describe what the program will do (analysis) and how it will do it (design the program in the form of a pseudocode algorithm). Include suitable prompts for all inputs, and label all outputs appropri- ately. After you have coded a program, be sure to test it with a reasonable set of legitimate inputs. 1 The tax calculator program of the...
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...