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
A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
Irina18 [472]
Documentation and time management
7 0
4 years ago
Read 2 more answers
Given two int variables matricAge and gradAge, write a statement that gives gradAge a value that is 4 more than the value of mat
Nesterboy [21]

Answer:

The following are the code to this question:

gradAge = 4 + matricAge; // add value 4 in matricAge and store it value in gradAge variable

Explanation:

In the given question it is already defined, that two integer variable, that is "matricAge and gradAge" is declared, that holds some value.

In the above code, we use both the above-declared variable and add value 4 in the "matricAge" variable and store its calculated value into the  "gradAge" variable    

8 0
3 years ago
If you're under 18 and you receive _____ or more license points in 12 months, you'll be restricted to driving only to school or
IRISSAK [1]

Answer:

B:6

Explanation:

FLVS :)

6 0
4 years ago
What is command is used to improve the vocabulary and in which tab is it found​
Sholpan [36]

Answer:

Writers Talk About Writing

Ctrl+Shift+Return: Keys to Your Computer

By Mike PopeOctober 15, 2012

Your computer's keyboard has around 110 keys by which you can make your wishes known to the machine. Most of these have obvious labels: if you press the A key, the letter A appears on the screen. Some are less obvious, though — the Shift key and the mysterious Ctrl key — and in this article I'll explore why they're named what they're named.

Long before computers, many practical issues about using a machine to write had already been worked out for the typewriter. If you've never used a typewriter, you might be interested in this video that shows one in action.

5 0
3 years ago
What are the steps to add text in Kinzoa Movie Maker?
ella [17]

Answer:

There should be a tab titled "add text." Click on that and add your text.

Explanation:

8 0
3 years ago
Other questions:
  • Net Worth is equal to assets minus liabilities. Which event will have the greatest impact (positive or negative) on one's net wo
    5·1 answer
  • The main benefit of shielded twisted pair cabling over unshielded twisted pair is that STP is much more durable.
    13·1 answer
  • List three ways security could be improved for taking the prepared deposit monies to the bank?​
    11·1 answer
  • ___ is a family of data formats that helps people automatically receive feeds anytime there are new postings to their favorite b
    14·1 answer
  • Difference between server and a client computer
    7·1 answer
  • I am a mouse, but im not a mouse.<br><br> What am I?
    12·1 answer
  • What is node ? Briefly explain with diagram<br><br>​
    8·1 answer
  • Write a program to find a perimeter of rectangle using SUB.. ..End SUB​
    14·2 answers
  • What does a computer monitor look like when struck really hard?
    15·1 answer
  • The pci express version 4.0 can provide up to what amount of throughput with 16 lanes for data?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!