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
1. How many bits would you need to address a 2M × 32 memory if:
Dominik [7]

Answer:

  1. a) 23       b) 21
  2. a) 43        b) 42
  3. a) 0          b) 0

Explanation:

<u>1) How many bits is needed to address a 2M * 32 memory </u>

2M = 2^1*2^20, while item =32 bit long word

hence ; L = 2^21 ; w = 32

a) when the memory is byte addressable

w = 8;  L = ( 2M * 32 ) / 8 =  2M * 4

hence number of bits =  log2(2M * 4)= log2 ( 2 * 2^20 * 2^2 ) = 23 bits

b) when the memory is word addressable

W = 32 ; L = ( 2M * 32 )/ 32 = 2M

hence the number of bits = log2 ( 2M ) = Log2 (2 * 2^20 ) = 21 bits

<u>2) How many bits are required to address a 4M × 16 main memory</u>

4M = 4^1*4^20 while item = 16 bit long word

hence L ( length ) = 4^21 ; w = 16

a) when the memory is byte addressable

w = 8 ; L = ( 4M * 16 ) / 8 = 4M * 2

hence number of bits = log 2 ( 4M * 2 ) = log 2 ( 4^1*4^20*2^1 ) ≈ 43 bits

b) when the memory is word addressable

w = 16 ; L = ( 4M * 16 ) / 16 = 4M

hence number of bits = log 2 ( 4M ) = log2 ( 4^1*4^20 ) ≈ 42 bits

<u>3) How many bits are required to address a 1M * 8 main memory </u>

1M = 1^1 * 1^20 ,  item = 8

L = 1^21 ; w = 8

a) when the memory is byte addressable

w = 8 ; L = ( 1 M * 8 ) / 8 = 1M

hence number of bits = log 2 ( 1M ) = log2 ( 1^1 * 1^20 ) = 0 bit

b) when memory is word addressable

w = 8 ; L = ( 1 M * 8 ) / 8 = 1M

number of bits = 0

5 0
2 years ago
Peter works on a huge database of numerical figures in a worksheet ranging from cell A1 to cell I50. He has to print the workshe
Amiraneli [1.4K]
Landscape and portrait page orientation.
4 0
3 years ago
Read 2 more answers
Discuss Hardware is useless without software?​
Alexus [3.1K]

Explanation:

Hardware is useless without software because the machinery will not and cannot do anything without programming to tell it what to do. Without an operating system, the computer can't do anything. Without other software, like Microsoft Office, you can't type anything or listen to music or watch video or anything

7 0
2 years ago
Case Project 9-4: Troubleshoot an IP configurationYou work at a help desk and have just received a call from an employee who say
Svetllana [295]

Answer:

To get the IP address and other information on the workstation, type 'ipconfig' for windows or 'ifconfig' or Linux and press the return key.

The subnet mask is a class B type and 169.254.14.11 IP address shows that the workstation cannot access the DHCP server, so the IP address is not properly configured for network connection.

Explanation:

A computer network is an interconnection and intercommunication of two or more computer devices. All devices in a network must have an IP address, which can be static or dynamic from a DHCP server.

When a computer is configured to receive IP address from a DHCP server, but cannot reach the server, the IP address from the range of 169 is automatically assigned to it but still would not be able to communicate with other devices in the network.

4 0
2 years ago
Your Windows client systems are joined to the WestSim domain. To ensure correct time stamps are used, you need to verify that th
natita [175]

<u>Full question:</u>

Your Windows 7 client systems are joined to the WestSim.com domain. To ensure correct time stamps are used, you need to verify that these clients are configured for the appropriate time zone.

Which command can you use to do this?

• w32tm /tz

• w32tm /monitor

• w32tm /register

• w32tm /query /status

<u>Answer:</u>

w32tm /tz command can you use to do this

<u>Explanation:</u>

W32tm.exe is the approved command-line mechanism for configuring, monitoring, or troubleshooting the Windows Time service. This mechanism is a portion of the default connection between Windows and Windows Server. One can use W32tm.exe to configure Windows Time service settings and to diagnose time setting obstacles.

The syntax is W32tm </parameter> </param2>. w32tm /tz will represent contemporary time zone settings. The Windows Time service is not a full-featured NTP clarification that convenes time-sensitive reinforcement requirements, and it is not verified by Microsoft as such.

6 0
3 years ago
Other questions:
  • Explain how to use fortran programming in details
    14·1 answer
  • : How does the founder of Wikipedia keep a tight reign on accuracy? HELP PLEZ AT LEAST A PARGRAPH PLES
    6·1 answer
  • Which type of interview is conducted in a format where the interviewee is questioned and presented to a panel of individuals?
    7·2 answers
  • What was the original motivation for developing the internet?
    7·1 answer
  • A technician removes the cap from the brake fluid reservoir and finds that the rubber boot in the cap is swollen. technician a s
    8·1 answer
  • A ____ object is used to hold data that is retrieved from a database via the OleDbDataAdapter connection. a. DataRecord b. DataS
    12·2 answers
  • 11111 Power 2 sovle ​
    14·1 answer
  • Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
    12·1 answer
  • Would you consider upgrading Maxine’s wardrobe a need or a want?
    11·1 answer
  • Convertbinary(111100)to decimal​​​​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!