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
File-sharing programs such as Napster, Kazaa, and iMesh make it possible for individuals to exchange music files over the Intern
Mashutka [201]

Answer:

Option A) Demand for CDs has decreased, causing equilibrium price and quantity to decrease.

is the correct answer.

Explanation:

  • File-sharing is a common practice nowadays. It helps us by providing access to different files (audio , video, images, documents) to others in a faster way.
  • A wide range of files are shared daily by using different means of file-sharing including computer networks and peer-to-peer networking.
  • Formerly, the data was shared using CDs but now this system has been replaced with the advent of internet.
  • Usage of CDs is dropped drastically and hence their demand is decreased.
  • So now the prices of CDs are not in equilibrium and their quantity is also decreased.

i hope it will help you!

3 0
3 years ago
The ____ is a tool in versions of microsoft office starting with office 2007 that consists of tabs, which contain groups of rela
tankabanditka [31]

The answer is A. The Ribbon is a UI component which was presented by Microsoft in Microsoft Office 2007. It is situated underneath the Quick Access Toolbar and the Title Bar. It includes seven tabs; Home, Insert, Page design, References, Mailing, Review and View. Every tab has particular gatherings of related summons.

6 0
3 years ago
Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
Kamila [148]

Answer:

B.   Click the Next icon on the Reviewing toolbar to review and then accept or reject each edit.

Explanation:

Since Jack wants to keep some changes and reject others, he can't use  a global solution (like presented in answers A and C).

He has to go through each and every change proposition and decide individually if he wants to keep the change or not.  That's why it's answer B.

It's the only way to accept some, reject some.  

At the end of this process, he'll have a clean document with Rob's recommendations and his original documents.

3 0
3 years ago
"Explain the functionality of the different layers found in the network protocol stack of an operating system such as Linux"
arsen [322]

Answer:

There are 7 layers in linux.

Explanation:

As networking is difficult and complex.

Imagine if every application had to know how to communicate on every step that would be more than just complex. So, rather than reinvent something which will help it to communicate let’s just make something that will automatically controls the communication and for that protocols came in to live.

As for the linux operating system, it is not exceptional from other operating systems.

There are 7 layers on network protocol stack use to communicate with other network protocol stack.

1. Application layer

2. System call interface

3. Protocol agnostic interface

4. Network protocol

5. Device agnostic interface

6. Device drivers

7. Physical hardware

All the layers vary in their functionality.

One more important thing to remember is that the network protocol stack layers is not one way its 2 way communication. First, when a client request to a network and second, when the request is full filled.

The top most layer is a part of user space, the next five layers comes in the kernel space and the final layer is the physical layer.

<u>Application layer: </u>

When a client or user request to  a network the request initially comes to this layer.

On this layer we use tcp/ip protocol.

<u>System call interface(SCI): </u>

When application layer make a call to the kernel this layer handles that call. And take the request to the next layer.

<u>Protocol agnostic interface: </u>

This layer has two functions “talking” or “listening”. There is a thing called sockets which perform these functions and each socket has an id which is used specifically for an application.

<u>Network protocol: </u>

This layer is used for how the data is sent or received.

<u>Device agnostic interface: </u>

It is used to connect data from/to kernel user space and the network device drivers which allows the data to prepare itself for transmission over the medium from the network device.

<u>Physical hardware : </u>

This layer is responsible for the data packets transmission and received from the network medium being used whether cable or wireless.

5 0
3 years ago
Write a program that accepts a phrase of unspecified length on the command line. For example: prompt% letter print Operating Sys
Sedaia [141]

Answer:

Check the explanation

Explanation:

#define _MULTI_THREADED

#include <pthread.h>

#include <stdio.h>

#include <errno.h>

#define           THREADS          2

int               i=1,j,k,l;

int argcG;

char *argvG[1000];

void *threadfunc(void *parm)

{

int *num;

num=(int*)parm;

while(1)

   {

   if(i>=argcG)

   break;

   if(*num ==1)

   if(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u')

   {

   printf("%s\n",argvG[i]);

   i++;

   continue;

   }

    if(*num ==2)

   if(!(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u'))

   {

   printf("%s\n",argvG[i]);

   i++;

   continue;

   }

   sched_yield();

   }

return NULL;

}

int main(int argc, char *argv[])

{

pthread_t            threadid[THREADS];

int                  rc=0;

int                  loop=0;

int arr[2]={1,2};

argcG=argc;

for(rc=0;rc<argc;rc++)

argvG[rc]=argv[rc];

printf("Creating %d threads\n", THREADS);

for (loop=0; loop<THREADS; ++loop) {

     rc =pthread_create(&threadid[loop], NULL, threadfunc,&arr[loop]);

}

for (loop=0; loop<THREADS; ++loop) {

   rc = pthread_join(threadid[loop], NULL);

}

printf("Main completed\n");

return 0;

}

The below attached image is a sample output

3 0
3 years ago
Other questions:
  • What operator is used to create a validation rule? A. – B. / C. &lt; or &gt; D. +
    12·1 answer
  • Which of the following are typically an example of primary resources?
    13·1 answer
  • A stateless firewall inspects each incoming packet to determine whether it belongs to a currently active connection.
    9·1 answer
  • How to find out what windows version i have?
    10·1 answer
  • Computer software is regarded a bridge between the hardware and software.elaborate the statement outlining types and functions o
    10·1 answer
  • View which is used to specify the tables fields , their data types and properties ​
    9·2 answers
  • How does a modem work​
    13·1 answer
  • Which of the following statements best illustrates how value was created for eggs? when a farmer sells a chicken who is no longe
    9·1 answer
  • 84 104 101 32 97 110 115 119 101 114 32 105 115 32 53 48 33 There's a way to make this meaningful; find it!
    14·1 answer
  • Which combining form is spelled incorrectly? group of answer choices gynic/o carcin/o nephr/o laryng/o
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!