answer.
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
dangina
14 days ago
14

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

ft, $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. Write a program that prompts the user for hours worked and shift, and, if the shift is 2 or 3, whether the worker elects the retirement. Display: (1) the hours worked, (2) the shift, (3) the hourly pay rate, (4) the regular pay, (5) overtime pay, (6) the total of regular and overtime pay, and (7) the retirement deduction, if any, and (8) the net pay. Save the file as AcmePay.java.
Business
1 answer:
marusya05 [3.1K]14 days ago
5 0

Response:

Program code

file name: AcmePay.java

import java.util.Scanner;

public class Payroll {

public static void main(String[] args) {

double[] shiftPay = { 17, 18.50, 22 };

double hourlyPayRate = 0, regularPay = 0, overTimeHours = 0, overTimePay = 0, retirementDeduction = 0,

netPay = 0;

System.out.println("*** Employee Pay ***");

// scanner instance to collect input data

Scanner scan = new Scanner(System.in);

// capture hours worked from user input

System.out.print("Enter the number of hours worked: ");

double numHours = scan.nextDouble();

// capture the shift

System.out.print("Enter the shift (1 - 3): ");

int shift = scan.nextInt();

hourlyPayRate = shiftPay[shift];

// compute regularPay

regularPay = numHours * hourlyPayRate;

if (numHours > 40) {

overTimeHours = numHours - 40;

overTimePay = overTimeHours * (hourlyPayRate * 1.5);

}

// calculate grossPay

double grossPay = regularPay + overTimePay;

// verify if retirement plan is an option

if (shift == 2 || shift == 3) {

System.out.print("Did the worker elect for retirement (1 for yes, 2 for no): ");

int chooseRetirement = scan.nextInt();

if (chooseRetirement == 1) {

// calculate retirement contribution

retirementDeduction = (grossPay * 0.03);

}

}

// calculate netPay

netPay = grossPay - retirementDeduction;

// output details to stdout

System.out.println("Hours worked: " + numHours);

System.out.println("Shift: " + shift);

System.out.println("Hourly Pay rate: " + hourlyPayRate);

System.out.println("Regular Pay: " + regularPay);

System.out.println("Overtime hours: " + overTimeHours);

System.out.println("Overtime pay: " + overTimePay);

System.out.println("Total of regular and overtime pay (Gross pay): " + grossPay);

System.out.println("Retirement deduction, if any: " + retirementDeduction);

System.out.println("Net pay: " + netPay);

// close scanner instance

scan.close();

}

}

Clarification:

You might be interested in
Suppose the observed annual quantity of steel exchanged in the European market is 30 million metric tons, and the observed marke
Free_Kalibri [3195]
The price coefficient (b) in the linear demand function is calculated as -0.10, derived from the elasticity of demand formula. By substituting known quantities into the equation, we find that the slope b equals -0.10.
5 0
14 days ago
What happens if Jeff refuses to pay the equilibrium wage for coffee shop employees?
stepan [3027]
If employees report him for fraud, he could face legal repercussions.
4 0
10 days ago
Read 2 more answers
The tool crib at a large manufacturing company is responsible for providing tools to the factory workers on demand. The tool cri
Nady [2970]

Answer:

6.4 minutes

Explanation:

Daily average for small tools = 445

Working hours = 8, which translates to 8*60 = (480 minutes)

Waiting time =

\frac{[445*(\sqrt{1} )]}{[2*[480-(445*1)]]} (image of the operation in the attached file)

= [445]/[(2*35)]

= 445/70

= 6.357 minutes

3 0
1 month ago
Jo is an honest and straightforward person. She believes her employees are all similarly honest and straightforward, ignoring si
Katen [2951]

The full question is:

Jo is a candid and honest individual. She holds the belief that her staff shares the same honesty and straightforwardness, overlooking any indications that they might be deceiving her. Which perceptual shortcut is Jo most likely employing? a. prototypingb. contrast effect c. halo effect d. stereotyping e. projection

Answer:

Projection

Explanation:

Psychological projection is an unconscious tendency where a person ascribes their own qualities to others. This can manifest as either positive or negative projection.

In Jo's situation, her own honesty and straightforwardness lead her to assume the same about those around her. Consequently, she fails to recognize signs of dishonesty that suggest she is being manipulated.

7 0
21 day ago
Read 2 more answers
An investment pays you $30,000 at the end of this year, and $15,000 at the end of each of the four following years. What is the
Nady [2970]

Answer:

The present value of the cash flow, discounted at a 5% annual rate, is $76,815.65.

Explanation:

First, we calculate the present value of a $15,000 annuity over 4 years:

C \times \frac{1-(1+r)^{-time} }{rate} = PV\\

C 15,000.00

Time 4

Rate 0.05

15000 \times \frac{1-(1+0.05)^{-4} }{0.05} = PV\\

PV $53,189.2576

Next, we discount two additional years as a lump sum, corresponding to two years following the investment:

\frac{Maturity}{(1 + rate)^{time} } = PV  

Maturity  53,189.26

Time  2.00

Rate  0.05000

\frac{53189.2575624354}{(1 + 0.05)^{2} } = PV  

PV   48,244.2245

Adding them results in the present value:

48,244.22 + 28,571.43 =  76,815.65  

8 0
1 month ago
Other questions:
  • Salmone Company reported the following purchases and sales of its only product. Salmone uses a perpetual inventory system. Deter
    6·1 answer
  • A software engineer believes that if she can complete her current project on time she will get her much awaited promotion to the
    9·1 answer
  • Jackson Electric Services Company incurred​ $800 as a repair expense and paid for it in cash. The company is a sole proprietorsh
    15·1 answer
  • Zen Manufacturing Company is considering replacing a four-year-old machine with a new, advanced model. The old machine was purch
    8·1 answer
  • Distinguish between medium and higher level education with<br>illustration.​
    15·1 answer
  • Rizzo Company has debentures ($1,000 par) outstanding that are convertible into the company's common stock at a price of $25. Th
    11·1 answer
  • Microsoft and a smaller rival often have to select from one of two competing technologies, A and B. The rival always prefers to
    5·1 answer
  • This month, a company receives $5,000 from a regular customer, of which $3,000 is for products delivered last month and $2,000 i
    14·1 answer
  • A pizza company produces frozen pizzas in three departments: assembly, freezing, and packaging. In assembly, crust ingredient ar
    12·1 answer
  • Harrelson Company manufactures pizza sauce through two production departments: Cooking and Canning. In each process, materials a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!