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
How do I mark someone brainiest
svet-max [94.6K]

Answer:

when someone answers your questio correctly, you will see a red crown. Click on that and mark them the most brainiest

Explanation:

3 0
2 years ago
Read 2 more answers
Write the steps for renaming an existing folder​
vekshin1

Answer:

Rename a file or folder

Explanation:

1.Right-click on the item and select Rename, or select the file and press F2 .

2.Type the new name and press Enter or click Rename.

8 0
3 years ago
Read 2 more answers
If Count = 1 and X = 3, what will be displayed when code corresponding to the following pseudocode is run? Do Set Y = Count + X
kirill115 [55]

Answer:

4 5 6

Explanation:

Since there is a do-while loop, you need to check the values for each iteration until the condition (Count <= X) is not satisfied.

First iteration ->  Count = 1 and X = 3, Y = 1 + 3, Write Y -> 4

Second iteration ->  Count = 2 and X = 3, Y = 2 + 3, Write Y -> 5

Third iteration ->  Count = 3 and X = 3, Y = 3 + 3, Write Y -> 6

After the third iteration count is equal to 4 and X is equal to 3. That is why loop ends.

3 0
3 years ago
Write java code to create a new class called "student". an object of the student class has attributes like student id, name and
Fiesta28 [93]
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.

public class student {
    private String _id;
    private String _name;
    private String _address;

    public student(String id, String name, String address) {
        _id = id;
        _name = name;
        _address = address;
    }

    public String toString() {
        return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
    }

    public static void main(String[] args) {
        student s1 = new student("S12345", "John Doe", "Some street");
        System.out.println(s1);
    }
}

8 0
2 years ago
How telecommunications works?​
SIZIF [17.4K]

Answer:

Telecommunications are the means of electronic transmission of information over distances. The information may be in the form of voice telephone calls, data, text, images, or video. Today, telecommunications are used to organize more or less remote computer systems into telecommunications networks.

Explanation:

3 0
2 years ago
Other questions:
  • NEED ASWERS FAST
    12·1 answer
  • How many people watch Anime in the world?
    15·2 answers
  • How do I download the Microsoft word on my Hp probook
    8·2 answers
  • When you open as many links as you want, and still stay in the same browser window instead of cluttering your screen with multip
    5·1 answer
  • You are purchasing several PC systems that will be used as thin clients in a large organization. Which hardware selection criter
    9·1 answer
  • What key should i press to leave the cell as it orginally was
    9·1 answer
  • Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.
    10·1 answer
  • Which of the following represents knowledge as a set ofâ rules? A. Neural networks.B. Machine learning systems.C. Robotics.D. Ex
    11·1 answer
  • What are the steps to open the Custom AutoFilter dialog box?
    5·2 answers
  • SOMEONE PLEASE HELP ME WITH THIS PLEASE HELP ME PLEASE!!!!!!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!