1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ra1l [238]
3 years ago
5

Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift

, $17 per hour; second shift, $18.50 per hour; third shift, $22 per hour. Each factory worker might work any number of hours per week; any hours greater than 40 are paid at one and one-half times the usual rate. In addition, second- and third-shift workers can elect to participate in the retirement plan for which 3% of the worker’s gross pay is deducted from the paychecks.
Required:
Write a program that prompts the user for hours worked, shift, and, if the shift is 2 or 3, whether the worker elects the retirement (1 for yes, 2 for no). Display: Hours worked Shift Hourly pay rate Regular pay Overtime pay Total of regular and overtime pay Retirement deduction, if any Net pay.
Computers and Technology
1 answer:
alexira [117]3 years ago
3 0

Answer:

# Initialize the values

overtime_pay = 0

deduction = 0

# Ask the user to enter hours and shift

hours = int(input("Enter hours worked: "))

shift = int(input("Enter shift[1/2/3]: "))

# Check the shift. If it is 1, set the hourly rate as 17

# If the shift is either 2 or 3, ask for participation to retirement plan

# If shift is 2, set the hourly rate as 18.50

# If shift is 3, set the hourly rate as 2

if shift == 1:

   horly_pay_rate = 17

elif shift == 2 or shift == 3:

   retirement = int(input("Participate in the retirement plan? [1 for yes, 2 for no]: "))

   if shift == 2:

       horly_pay_rate = 18.50

       

   if shift == 3:

       horly_pay_rate = 22

# Check the hours. If it is smaller than or equal to 40, calculate only regular pay

# If hours is greater than 40, calculate regular and overtime pay

if hours <= 40:

   regular_pay = (hours * horly_pay_rate)

elif hours > 40:

   regular_pay = (40 * horly_pay_rate)

   overtime_pay = (hours - 40) * (horly_pay_rate * 1.5)        

#calculate total pay

total_pay = regular_pay + overtime_pay

# Check the retirement. If it is 1, calculate and apply deduction

if retirement == 1:

       deduction = total_pay * 0.03

       net_pay = total_pay - deduction

else:

   net_pay = total_pay

   

#print the results

print("Hours worked: " + str(hours))

print("Shift: " + str(shift))

print("Hourly pay rate: " + str(horly_pay_rate))

print("Regular pay: " + str(regular_pay))

print("Overtime pay: " + str(overtime_pay))

print("Total of regular and overtime pay: " + str(total_pay))

print("Retirement deduction: " + str(deduction))

print("Net pay: " + str(net_pay))

Explanation:

*See the comments in the code

You might be interested in
Listed items that are not in any particular order should be identified with _____.
NeTakaya

A dictionary or other type of informational book

5 0
3 years ago
Given this method comment, fill in the blank in the method implementation. /* Deposits money into the bank account amount: the a
DIA [1.3K]

Answer:

"void" is the correct answer for the given question.

Explanation:

In the function body the value of balance variable is not return that means we use void return type .The void return type is used when the function does not return any value .

If the function are  int return type that means it return "integer value ".

if the function are  double return type that means it return the "double value" .

The complete implementation of this method is

public void deposit(double amount) // function definition  

{

balance = balance + amount; // statement

}

3 0
3 years ago
A ________ pays out cash flows from a collection of assets in different tranches, with the highest-rated tranch paying out first
KonstantinChe [14]

Answer:

The correct option to the following question is CDO(Collateralized Debt Obligation).

Explanation:

CDO(collateralized debt obligations), is the financial tool that is used by the banks to repackage the individual loans into the product sold to the investors on secondary markets.

It developed as the instruments for corporate debts markets, after the year 2002, CDO became the vehicles for refinancing the mortgage backed the securities.

A CDO is the type of the structured asset backed security.

3 0
3 years ago
Lionbridge theory test
marishachu [46]
What about it kidddddd
4 0
3 years ago
Read 2 more answers
Hard disk works on the following technologies: (i) Technology used within the hard drive to read &amp; write data to the drive a
Alex787 [66]

Answer:

The green-blue circuit board you can see in the first photo includes the disk controller, a circuit that allows the computer to operate the drive's mechanisms and read/write data to and from it. ... A small hard drive typically has only one platter, but each side of it has a magnetic coating

Explanation:

8 0
2 years ago
Other questions:
  • How to search multiple microsoft word documents?
    15·1 answer
  • Microcomputers, different from those giant mainframes and supercomputers, are designed for individuals. In fact, the microcomput
    7·1 answer
  • The moon has less mass than the earth, so what happens to objects on the moon?
    11·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • The first numerical control machine tool was demonstrated in 1952 in the United States at the Massachusetts Institute of Technol
    14·1 answer
  • What is the missing line of code?
    10·2 answers
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • Multiple Choice
    8·1 answer
  • Identify and explain groups that may be impacted by nanotechnology.
    13·1 answer
  • A network administrator wants to authenticate server machines using Transport Layer Security (TLS). What can the administrator i
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!