Question

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 pay minus the taxes. (Using python on Visual Studio).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

hours=int(input("Enter number of hours: "))

hourRate=float(input("Enter hour rate: "))

gross=hours * hourRate

tax=0

if gross <=300:

  tax=gross*0.15

elif(gross>300 and gross<=450):

  tax=300*0.15

  tax+=(gross-300)*0.20

else:

  tax=300*0.15

  tax+=150*0.2

  tax+=(gross-450)*0.25

net=gross-tax

print("Gross : $",gross)

print("Tax : $",tax)

print("Net : $",net)

  

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
write the code in python programming that will read in the following from the user. Hourly...
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
  • 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)

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

  • Data Programming l: PYTHON 1. Write a program that computes your gross pay. Your code should...

    Data Programming l: PYTHON 1. Write a program that computes your gross pay. Your code should get two numbers: hours and rate per hour. You should give the employee 1.75 times the hourly rate for hours worked above 40 hours. Output: Your gross pay is $487.5 2. Rewrite the previous program using try and except so that your program handles non-numeric inputs gracefully by printing a message and exiting the program. The following shows two executions of the program with...

  • Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code:...

    Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code: SALARY Input first and last name - Output the names last, first in your output - Make the federal withholding rate a constant 20% (not an input value) No state tax Generate two new values: regular pay and overtime pay - 40 hours workedor less - Regular pay is pay rate * hours worked - Overtime pay is 0 Otherwise - Regular pay is...

  • This is my python assignment You wrote a program to prompt the user for hours and...

    This is my python assignment You wrote a program to prompt the user for hours and rate per hour to compute gross pay. Also your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. Enter Hours: 45 Enter Rate: 10 Pay: 475.0 (475 = 40 * 10 + 5 * 15) Rewrite your pay program using try and except so that your program handles non-numeric input gracefully. Enter Hours: 20 Enter Rate:...

  • This is a Java beginner class. Write the following exercise to check the user inputs to...

    This is a Java beginner class. Write the following exercise to check the user inputs to be: Valid input and positive with using try-catch (and/or throw Exception ) ************************************************************************** Write a program to prompt the user for hours and rate per hour to compute gross pay. Calculate your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours. Your code should have at least the following methods to calculate the pay. (VOID and...

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

  • JAVA Programming . Description: For an unknown number of employees: prompt and receive payroll data; calculate...

    JAVA Programming . Description: For an unknown number of employees: prompt and receive payroll data; calculate gross pay, taxes owed, and net pay; and display a pay stub. Input : Prompt and receive input from the user for the following:  /// Employee’s First and Last Name  /// Hours Worked  /// Pay Rate  /// Overtime Rate Multiplier ** For the Employee’s First and Last Name:  Both data items must be read in one prompting into one...

  • Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a...

    Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a wage calculator for a single user. The program will use the user's number of hours worked and their hourly wage to calculate: Gross Pay Deduction Net Pay The Gross Pay is the amount that the user is paid before any deduction is applied. The pay amount is based upon the number of hours worked. If 40 hours or less were worked, the gross pay...

  • Programming Exercise 1. Show fully functioning code that can be pasted into a new Python IDLE...

    Programming Exercise 1. Show fully functioning code that can be pasted into a new Python IDLE file and function correctly. Show the output that would result from each of the following possible inputs: 3, 4, 5 a) wollot sd 3, 3, 3 b) c) 5, 4, 3 d) 3, 5, 2 oaeb e) 5, 4, 7 f) 3, 3, 2 Programming Exercises 1. Many companies pay time-and-a-half for any hours worked above 40 in a given week. Write a program...

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