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]
2 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]2 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
*
asambeis [7]

Answer:

I think they're all valid but the validility depends on the website your using the usernames on.

Explanation:

6 0
2 years ago
Where is permanent data in the computer stored whenever gym starts his laptop He sees some commands in numbers appearing on the
Nostrana [21]

Permanent storage, also called persistent storage, A permanent storage of the computer is hard disk. The data stored in hard disk is permanent. It is primary use is long-term data storage.gym starts his laptop He sees some commands in numbers appearing on the screen these instructions are being preceded by the control unit because when hr start the data is loaded and take some time.

4 0
3 years ago
design aDesign a queue abstract data type for float elements in a language that you know, including operations for enqueue, dequ
Yuri [45]

Answer:

Check the explanation

Explanation:

Due to difficulty in submitting the code on the brainly text editor, it has been written and uploaded, check the below attached image that shows the designed queue abstract data type <u><em>(which is defined by the following operations and structure, when a queue is structured, as expressed in the above statement, as an prepared or structured item collection which are added at one end, that is often called the “rear,” and detached from the other end, called the “front.”) </em></u>for float elements.

8 0
3 years ago
How do i show all emails from same sender in outlook
OverLord2011 [107]

Your just gonna have to scroll through all of them until you find the right one or search for some key words.

4 0
3 years ago
Read 2 more answers
Your company is implementing a wireless network and is concerned that someone from a competing company could stand outside the b
Mila [183]

Answer:

(A)AES

Explanation:

WPA2 (Wi-Fi Protected Access 2) is a security protocol which was developed by the Wi-Fi Alliance in 2004. It was used to replace the security protocol of WEP(Wired Equivalent Privacy) and WPA.

Unlike the previous security protocol, WPA2 uses the Dvanve Encryption Standard (AES) instead of the RC4 stream cipher. WPA3 has been developed but it is not yet widely in use.

4 0
3 years ago
Other questions:
  • What needs to be increased in order to increase image size and clarity?
    10·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • Effective presentations vary the color scheme on each slide.
    7·2 answers
  • 1. The global economy involves trading between people from different _____
    8·1 answer
  • A golf ball is at rest on the grass. What must happen to cause the ball to move?
    5·1 answer
  • What is required to contain warnings, after several studies that have shown that they are a suffocation risk?
    15·2 answers
  • Only technical managers needs to know about programming, web view source code and about technology issues.
    12·1 answer
  • You dad has given you his old digital scanner for your new computer. you plug it into the usb drive on your windows 8 computer b
    8·1 answer
  • You have this code in your program.
    7·1 answer
  • PLS HEEELLLP ASAP, DONT JOKE
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!