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
Kevin needs to get his data from a database into a text file to send to another group. He needs to _____.
Rasek [7]
A.Export

I got it right on test
6 0
3 years ago
Read 2 more answers
In 1970, the federal government created __________ to both assist and require employers and employees to make the prevention of
Aleksandr-060686 [28]

OSHA

Occupational Safety Health Administration

4 0
3 years ago
A team member who feels uncomfortable when disagreeing with another team member is likely from a(n) _______(fill in the blank) c
Delvig [45]

collectivistic culture

7 0
3 years ago
Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
Sedbober [7]

I believe the answer is A. because he has to listen to what the people tell him and he information he has to think about and make a choice on what to reply with.

I hope this helps and its correct please let me know if its wrong have a great day//night.

4 0
3 years ago
What type of game is LEAST LIKELY to need a structured narrative?
VladimirAG [237]

Answer:

Probably a sports game

Explanation:

A role-playing means acting it out, so you need to explain the life with a structured narrative.

An adventure game needs lots of background, so you need to fill that in with a structured narrative.

A sports game revolves solely around sports, so you only need to know how to play the game and/or sport, so no structured narrative is needed.

An fps game needs a structured narrative in that it is similar to an adventure game and needs background.

Let me know if I was right! Hope this helped. :)

5 0
3 years ago
Other questions:
  • What component on a smartphone requires pairing with another device?
    8·1 answer
  • We want to construct a memory with 256 bytes in capacity. Assume that each byte has a unique address. (a) How many address lines
    14·1 answer
  • Which routine is configured to be called by another routine?
    10·1 answer
  • A program uses two classes: dog and poodle. which class is the base class and which is the derived class?
    7·2 answers
  • Consider a system consisting of processes P1 , P2 , ..., Pn , each of which has a unique priority number. Write a monitor that a
    14·1 answer
  • LAB: Convert to binary - methods
    11·1 answer
  • Name the first mechanical computer​
    11·1 answer
  • state an application that would be better to write c++ than java and give a rationale for your answer
    5·1 answer
  • How many answer can you get daily
    7·2 answers
  • Dion Training has hired you to assess its voucher fulfillment web application on its e-commerce website. The web application rel
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!