Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ne a program h calculanes and cutputs he paysubfor an employee Net pay is caloda

ID: 3879695 • Letter: N

Question

ne a program h calculanes and cutputs he paysubfor an employee Net pay is calodated ater taking the tolowing deductions 1 Federal herme Tar 1600% 2 State Tax 4.80 fax575% 4 Medicare Tax 278% Person Plan 500% Health Insurance $8265 NOTE AI of the above should be declared as constants in your pregram ptic stanc tnal dutie FEDERAL,NCOME-TAG 15,w15% puti stak firal double STATE-TAX 048 04 g% pik ,Lac fral dutie HEALTH-INSURANCE 82 05, oseas The program will prompt the user runsing it for an enpoyee name, hors worked and houry rate. Please foemat the Gross Pay and Net Pay amounts to wo deoimal plaoes The anached Pay5bjava program is a good starng program or thee assgment What the ouput may look ike Wha is the Employee nane? Jen Claude How many hours did the Employee won? 38.5 Wht is the Erployee's rale of pay? 2765 Pay Stub for Jon Claude Hours Werked 38 Hourly Rate 27 Gross Pay $ 1064 5 Federal Inooe Tax 150 678749 Tax 51 07 100000000 Socia Seority Tax 01 210187409 Medcare Ta 29 583T 409909993 Pernsion Plan 53 22624909019999 Health Care 1265 Net Pay $ 627

Explanation / Answer


import java.util.Scanner;

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author Surya
*/
public class Employe_pay {
//constant variable declaratioon
public static final double FEDERAL_INCOME_TAX =0.15;
public static final double STATE_TAX = 0.048;
public static final double SOCIAL_SECURITY_TAX = 0.0575;
public static final double MEDICARE_TAX=0.0279;
public static final double PENSION_PLAN=0.05;
public static final double HEALTH_INSURANCE = 82.65;
public static void main(String argv[]){
//variable declaration
String name;
double hours,rate;
Scanner sc= new Scanner(System.in);
double gross,net;
  
//reading input
System.out.println("What is the employee name:");
name =sc.nextLine();
System.out.println("How many hours did the employee work:");
hours = sc.nextDouble();
System.out.println("What is the employe's rate of pay:");
rate = sc.nextDouble();
  
//calculating groos payment
gross = hours*rate;
net = gross;
//printing output
System.out.println("Pay Stub for "+name);
System.out.println("Hours worked: "+hours);
System.out.println("Hourly Rate: $"+rate);
System.out.println("Gross Pay $"+gross);
System.out.println("Federal Income Tax "+(FEDERAL_INCOME_TAX*gross));
net-=(FEDERAL_INCOME_TAX*gross);//deducting from gross
System.out.println("State Tax "+(STATE_TAX*gross));
net-=(STATE_TAX*gross);//deducting from gross
System.out.println("Social Security Tax "+(SOCIAL_SECURITY_TAX*gross));
net-=(SOCIAL_SECURITY_TAX*gross);//deducting from gross
System.out.println("Medcare Tax "+(MEDICARE_TAX*gross));
net-=(MEDICARE_TAX*gross);//deducting from gross
System.out.println("Pension Plan "+(PENSION_PLAN*gross));
net-=(PENSION_PLAN*gross);//deducting from gross
System.out.println("Health Care "+HEALTH_INSURANCE);
net-=HEALTH_INSURANCE;//deducting from gross
System.out.println("Net Pay "+net);
  
  
  
  
  
  
  
}
  
}

output:

run:
What is the employee name:
Jon Claude
How many hours did the employee work:
38.5
What is the employe's rate of pay:
27.65
Pay Stub for Jon Claude
Hours worked: 38.5
Hourly Rate: $27.65
Gross Pay $1064.5249999999999
Federal Income Tax 159.67874999999998
State Tax 51.097199999999994
Social Security Tax 61.210187499999996
Medcare Tax 29.700247499999996
Pension Plan 53.22624999999999
Health Care 82.65
Net Pay 626.9623649999997
BUILD SUCCESSFUL (total time: 33 seconds)