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]
4 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]4 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
The format painter button is found in the ____ group on the home tab of the ribbon.
Amanda [17]
<span>The format painter button is found in the <u><em>clipboard</em></u><em> </em>group on the home tab of the ribbon</span>
6 0
3 years ago
Which risk management framework does the organization of standardization publish
olga2289 [7]

Answer:

ISO 31000:2009 publishes principles and generic guidelines on risk management.

Explanation:

ISO 31000:2009 can be applied to any public, private or community company, organization, society or individual. Hence, ISO 31000:2009 is not particular to either business or area.

ISO 31000:2009 can be implemented during the period of an industry and to a broad variety of actions, including policies and judgments, guidance, methods, functions, plans, goods, services, and assets.

ISO 31000:2009 can be implemented to any type of danger, whatever its kind, whether possessing positive or negative outgrowths.

3 0
4 years ago
Who wants to play kahoot
Lapatulllka [165]

Answer:me

Explanation:

5 0
4 years ago
Read 2 more answers
After earning a learner’s license, what test must be successfully passed to earn an operator’s license?
ZanzabumX [31]
<span>The correct answer is Driving Skills Test.  After earning a learner’s license, Driving Skills test must be successfully passed to earn an operator’s license.  </span>50 hours of driving has to be documented and 10 hours driving at night time.
7 0
3 years ago
The Harrison Group Life Insurance company computes annual policy premiums based on the age the customer turns in the current cal
Ksenya-84 [330]

Answer:

The JAVA program for the scenario is given below.

import java.util.Scanner;

import java.lang.*;

public class Insurance

{

   //static variables to hold mandatory values

   static int age;

   static int premium;

   static int decades;

public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       //user prompted to enter present age

 System.out.print("Enter your age in current year: ");

 age = sc.nextInt();

 //computation to calculate premium amount

 decades = age/10;

 premium = (decades + 15)*20;

 System.out.println("");

 System.out.println("The annual premium to be paid for age "+age+" is $"+ premium);

}

}

OUTPUT

Enter your age in current year: 45

The annual premium to be paid for age 45 is $380

Explanation:

1. The variables are declared with integer datatype to hold customer age, decades and premium.  

2. All the variables are declared static so that they can be accessible inside main() which is a static method.

3. Inside main(), object of Scanner is created, sc.

4. User is asked to enter present age.

5. User input is taken into age using scanner object, sc and nextInt() method.

6. Following this, the decades in customer’s age is computed by dividing age by 10 and assigned to decades variable.

7. Next, annual premium is calculated by adding 15 to decades and then, multiplying the result by 20. The final result is assigned to premium variable.

8. A new line is inserted before printing the annual premium amount.

9. The calculated annual premium amount based on customer’s present age is displayed.

10. The class having main() method is named Insurance. Hence, the program is named as Insurance.java.

11. Only one class is taken in the program since nothing is specifically mentioned about classes in the question.

12. The Insurance class is declared public since execution begins with main() method.

13. If more than one class is present in the Java program, only the class having main() method is declared public; other classes are not declared public.

8 0
4 years ago
Other questions:
  • Using the CPI to calculate the inflation rate​ _______________ the underlying inflation​ rate, and using the core inflation rate
    7·2 answers
  • Boosting morale in a workplace through reorientation is accomplished by giving employees _____. a. snacks and drinks b. the same
    15·2 answers
  • His function starts a new session.
    12·1 answer
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • Roblox published a series of videos to help their audience use their creation engine, what are they called?​
    9·2 answers
  • What are the two types of computers
    15·2 answers
  • Some projectors use a connection technology called _______________ that enables long-range connectivity for uncompressed HD vide
    12·1 answer
  • Thomas is getting ready for a presentation. His slides are set, and he's
    12·1 answer
  • How much tabs can you open with 8GB of ram? ​
    6·1 answer
  • List three natural defects of wood<br>​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!