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
2 months 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.7K]2 months 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
Hamby Corporation is preparing a bid for a special order that would require 780 liters of material W34C. The company already has
soldi70 [3635]

Answer:

$6,513

Explanation:

The calculation for the relevant cost is illustrated below:

= Volume of raw material × cost per liter of raw material

= 780 liters × $8.35 per liter

=

$6,513

Thus, we derived the total by multiplying the volume of raw material by its price per liter to arrive at the accurate cost

Any other information provided is not necessary. Therefore, it was disregarded

3 0
1 month ago
Synergy and Dynaco are the only two firms in a specific high-tech industry. They face the following payoff matrix as they decide
Mariulka [3825]

Answer:

Explanation:

Synergy's Choices Large Budget Small Budget Dynaco's Choices Large Budget $20 million, $25 million $15 million, $0 Small Budget $0, $60 million $25 million, $30 million If Synergy assumes

If Synergy presumes Dynaco will opt for a large budget, then Synergy should also select a large budget.

If Synergy thinks Dynaco will choose a small budget, Synergy should still go for a large budget.

This indicates that Synergy indeed has a dominant strategy.

If Dynaco believes Synergy will pursue a large budget, it will likewise pursue a large budget.

Conversely, if Dynaco believes that Synergy will choose a small budget, it will choose a small budget as well.

Therefore, Dynaco lacks a dominant strategy.

Correctly stated, the Nash equilibrium is found at (large budget, large budget).

7 0
2 months ago
Other questions:
  • Your boss has given you permission to order new office supplies answer
    6·2 answers
  • 1. Which of the following people is/are legally required to file a tax return?
    9·1 answer
  • One learning aid provides an interactive​ walk-through for solving the particular problem you are working on. you are prompted w
    15·1 answer
  • Madeline spends all of her spare money on widgets, which cost $2 each, and gizmos, which cost $3 each. What is her opportunity c
    10·1 answer
  • You have full responsibility for the success of the test market at your store. Write a memo outlining the preparations that you
    11·1 answer
  • Preble Company manufactures one product. Its variable manufacturing overhead is applied to production based on direct labor-hour
    5·1 answer
  • A supermarket expects to sell 1000 boxes of sugar in a year. Each box costs $2, and there is a fixed delivery charge of $20 per
    12·1 answer
  • Suppose the united states has two​ utilities, commonwealth utilities and consolidated electric. both produce 20 million tons of
    9·1 answer
  • Toyota and Honda both have the capabilities to build cars of high quality at relatively low cost and their products regularly be
    6·1 answer
  • Imagine that you are holding 7,000 shares of stock, currently selling at $70 per share. You are ready to sell the shares but wou
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!