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
Vera_Pavlovna [14]
3 years ago
10

You are asked to write a program to help a small company calculate the amount of money to pay their employees. In this simplisti

c world, the company has exactly three employees. However, the number of hours per employee may vary. The company will apply the same tax rate to every employee.
Problem Description

Inputs (entered by user of the program)

• Name of first employee
• Hourly rate
• Number of hours worked
• Name of second employee
• Hourly rate
• Number of hours worked
• Name of third employee
• Hourly rate
• Number of hours worked
• Tax rate (between 0 and 1.0)

Processing and Output

• Calculate and display the amount each employee will be paid before taxes
• Calculate and display the amount each employee will be taxed
• Calculate and display the amount each employee will be paid after taxes have been withheld
• Calculate and display the total amount of taxes the company will withhold
• Display your name

You may separate the processing/calculation step from the output step or you may combine those steps. It is your choice.
Computers and Technology
1 answer:
zvonat [6]3 years ago
7 0

Answer:

See Explaination

Explanation:

Java Program:

/* Java Program that calculates payroll of a company */

import java.util.Scanner;

public class Main

{

//Main method

public static void main(String[] args) {

//Scanner class object

Scanner reader = new Scanner(System.in);

//Array to hold names

String[] names = new String[3];

//Array to hold hourly rate

double[] hourlyRate = new double[3];

//Array to hold hours worked

double[] hoursWorked = new double[3];

//Reading data from User

for(int i=0; i<3; i++)

{

System.out.print("\nEnter name of Employee #" + (i+1) + ": ");

names[i] = reader.nextLine();

System.out.print("Enter Hourly rate of Employee #" + (i+1) + ": ");

hourlyRate[i] = reader.nextDouble();

System.out.print("Enter Hours Worked by Employee #" + (i+1) + ": ");

hoursWorked[i] = reader.nextDouble();

reader.nextLine();

}

//Reading tax rate

System.out.print("\n\nEnter tax rate (between 0 and 1.0): ");

double taxRate = reader.nextDouble();

double companyWithholdTax = 0.0;

System.out.printf("\n %-15s %-15s %-15s %-15s \n", "Employee Name", "Pay Before Tax", "Tax Deducted", "Pay after Tax");

double tax, payBefore, payAfter;

//Printing result

for(int i=0; i<3; i++)

{

//Before tax

payBefore = hoursWorked[i] * hourlyRate[i];

//Computing tax

tax = payBefore * taxRate;

//After taxRate

payAfter = payBefore - tax;

companyWithholdTax += tax;

System.out.printf("\n %-18s %-15.2f %-15.2f %-15.2f ", names[i], payBefore, tax, payAfter);

}

System.out.printf("\n\nTotal amount of taxes company withhold: %.2f \n\n", companyWithholdTax);

}

}

You might be interested in
50 ) What is the cell address of 4th row and 4th column? A) 4D B) E4 оооо C) 04 D) B4​
blsea [12.9K]

Answer:

The cell address of 4th row and 4th column is

4D/D4

7 0
3 years ago
What software that allow for one-click performance profiles for msi video card??
vovangra [49]
<span>The MSI Gaming App allows for a one-click performance for profiles that unlock extra performance for gaming or to keep your card silent during light use.</span>
8 0
3 years ago
READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
OleMash [197]

Answer:

b

Explanation:

8 0
3 years ago
If you wish to sign out of your Microsoft account, tap or click ____ on the ribbon to open the Backstage view and then tap or cl
lyudmila [28]
If you wish to sign out of your Microsoft account, tap or click file on the ribbon to open the Backstage view and then tap or click the Account tab to <span>display the Account gallery, and tap or click the Sign out link. There are different ways to do that but it is the easiest.</span>
7 0
3 years ago
Match these step-by-step directions in the order that you will find them in this course.
7nadin3 [17]

Answer:

1.Go to the View tab and select Watch.

2.Comparison

3.Editing

4.Drawing (I think)

5.Predesigned slides available for creating a new presentation

Explanation:

6 0
3 years ago
Other questions:
  • A software program that allows a programmer to type in code. modern versions usually make it easy to format the code on the scre
    13·1 answer
  • In mathematics, the factorial of a positive integer n, denoted as n! , is the product of all positive integers less than or equa
    10·2 answers
  • Read the scenario, and then answer the question that follows.
    10·1 answer
  • Biomimicry is the term used when engineers are inspired by objects found in nature? Group of answer choices True False
    10·1 answer
  • Select each of the strategies you can use to be more efficient when using the Internet. using tabs creating tables creating book
    6·2 answers
  • What are the differences, physically and logically, between the two printing configurations: Network-attached Printing and Netwo
    7·1 answer
  • How did the use of ARPANET change computing?
    14·1 answer
  • What is the scope of numC?
    8·2 answers
  • • Use variable to create the number 0 at location 0, 400.
    11·1 answer
  • Did you know a security hacker is someone who explores methods for breaching defenses and exploiting weaknesses in a computer sy
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!