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
LenKa [72]
3 years ago
10

Write a program that reads in the first name, hourly rate and number of hours worked for 5 people. Print the following details f

or each employee. Name of employee The number of hours worked Their weekly gross pay.This is calculated by multiplying hours worked times hourly rate. If hours worked per week is greater than 40, then overtime needs to also be included. Overtime pay is calculated as the number of hours worked beyond 40 * rate * 1.5 Taxes withheld Our tax system is simple, the government gets 20% of the gross pay. Net paid The amount of the check issued to the employee.
Computers and Technology
1 answer:
Rasek [7]3 years ago
7 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

    String name;

    double hourlyRate;

    int hours;

    double grossPay = 0.0;

    double netPaid = 0.0;

    double taxes = 0.0;

   

    Scanner input = new Scanner(System.in);

   

    for (int i=1; i<=5; i++){

        System.out.print("Enter the name of the employee #" + i + ": ");

        name = input.nextLine();

       

        System.out.print("Enter the hourly rate: ");

        hourlyRate = input.nextDouble();

       

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

        hours = input.nextInt();

        input.nextLine();

       

        if(hours > 40)

            grossPay = (40 * hourlyRate) + ((hours - 40) * hourlyRate * 1.5);

        else    

            grossPay = hours * hourlyRate;

       

        taxes = grossPay * 0.2;

        netPaid = grossPay - taxes;

       

       

        System.out.println("\nName: " + name);

        System.out.println("The number of hours worked: " + hours);

        System.out.println("The weekly gross pay: " + grossPay);

        System.out.println("Taxes: " + taxes);

        System.out.println("Net Paid: " + netPaid + "\n");

    }

}

}

Explanation:

*The code is in Java

Declare the variables

Create a for loop that iterates 5 times (for each employee)

Inside the loop:

Ask the user to enter the name, hourlyRate and hours

Check if hours is above 40. If it is, calculate the gross pay and overtime pay using the given instructions. Otherwise, do not add the overtime pay to the gross pay

Calculate the taxes using given information

Calculate the net paid by subtracting the taxes from grossPay

Print the name, hours, grossPay, taxes, and netPaid

You might be interested in
Which Backstage view feature helps you to specifically remove customized information from a document? Protect Document Feedback
harina [27]

Answer:

properties

Explanation:

4 0
3 years ago
Which of the following is an example of phishing attack? csp
TEA [102]
There are no examples you imbecile it’s A
4 0
3 years ago
List some of the ways that healthcare information technology is making healthcare more of a self-service industry?
harkovskaia [24]

Health information technology (HIT)) is "the utilization of data preparing including both PC equipment and programming that manages the capacity, recovery, sharing, and utilization of medicinal services data.

<u>Explanation:</u>

  • Improving personal satisfaction is one of the primary advantages of incorporating new advancements into medication.
  • Restorative advancements like negligibly intrusive medical procedures, better-observing frameworks, and progressively happy with checking gear are enabling patients to invest less energy in recuperation and additional time getting a charge out of a solid life.
  • An essential advantage of offering self-administration checkouts is that clients need them, and effective retailers give what their clients need.
  • The principal innovation is advantageous to people for a few reasons. At the therapeutic level, innovation can help treat increasingly wiped out individuals and subsequently spare numerous lives and battle exceptionally hurtful infections and microscopic organisms.
  • Indeed, three explicit reasons that innovation is acceptable is that it spares lives by improving prescription, keeps us associated with one another, and gives instruction and stimulation.
  • One motivation behind why innovation is acceptable is that it has spared numerous lives.
  • Innovation additionally can be used to improve instructing and learning and help our students be successful.
3 0
3 years ago
Explain why you will not do these things when driving.<br><br>yall got one more time to delete it
sesenic [268]
Don't text and drive you could crash
5 0
3 years ago
Membrane-bound organelles are not found in the cells of A) bacteria. B) fungi. C) plants. Eliminate D) protists.
77julia77 [94]
The answer is A. Bacteria leave a thanks if i am correct please.
7 0
3 years ago
Read 2 more answers
Other questions:
  • A ____ document identifies the purpose of the program being developed, the application title, the procedures to be followed when
    11·1 answer
  • Does Logarithms and Algorithms same things?
    6·1 answer
  • (EASY 15 POINTS) What are two indications in a browser that a secure connection is being used?
    6·1 answer
  • A network slows down when a network card is locked in a perpetual mode
    12·2 answers
  • In the writing and language test of the SAT, questions ask students to do which of the following? A. Write an essay B. Define a
    14·2 answers
  • Write a c++ program to calculate the approximate value of pi using this series. The program takes an input n that determines the
    13·1 answer
  • What is required to contain warnings, after several studies that have shown that they are a suffocation risk?
    15·2 answers
  • Select the correct answer.
    15·2 answers
  • A(n) __________ prevents outsiders from accessing corporate information the user does not want others to see.
    9·1 answer
  • 11.6 Code Practice edhesive
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!