Question Details

[solution] » I'm working in java, I need to print out the gross pay, withheld

Brief item decscription

Step-by-step solution file


Item details:

I'm working in java, I need to print out the gross pay, withheld
More:

I'm working in java, I need to print out the gross pay, withheld amount, and the net pay for the user with appropriate text telling the user what each number is. This is what I have so far.


/*

 

* To change this license header, choose License Headers in Project Properties.

 

* To change this template file, choose Tools | Templates

 

* and open the template in the editor.

 

*/

 

package payroll;

 

/**

 

*

 

* @author ogdj1_000

 

*/

 

import java.util.Scanner;

 

import java.text.NumberFormat;

 

public class Payroll {

 

/**

 

* @param args the command line arguments

 

*/

 

public static void main(String args) {

 

Scanner input = new Scanner(System.in);

 

NumberFormat overtimeFormatter = NumberFormat.getCurrencyInstance();

 

NumberFormat grosspayFormatter = NumberFormat.getCurrencyInstance();

 

NumberFormat withheldFormatter = NumberFormat.getCurrencyInstance();

 

double hours, payrate =, grosspay, overtime, withheld =0.15, netpay;

 

System.out.printf("Please enter the number of hours worked ");

 

hours = input.nextDouble();

 

input.nextLine();

 

System.out.printf("Please enter the hourly payrate ");

 

overtime = (1.5 * (hours-40) * payrate);

 

grosspay = payrate * hours;

 

withheld = withheld * grosspay;

 

System.out.printf("Withheld amount is "+

 

withheldFormatter.format(withheld));

 

withheld = input.nextDouble();

 

input.nextLine();

 

if (hours <= 40)

 

{

 

System.out.printf("Gross pay for the week is " +

 

grosspayFormatter.format(grosspay));

 

}

 

else if(hours > 41) {

 

System.out.printf("Gross pay plus overtime for the week is " +

 

overtimeFormatter.format(overtime+grosspay));

 

}

 

}

 

}

 


 

 







About this question:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Feb 21, 2020

PRICE: $24

Solution~000328902.zip (18.37 KB)

Buy this answer for only: $24

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card. All your purchases are securely protected by PayPal.
SiteLock

Need a similar solution fast, written anew from scratch? Place your own custom order

We have top-notch tutors who can help you with your essay at a reasonable cost and then you can simply use that essay as a template to build your own arguments. This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student. New solution orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

Order Now