Question
import java.util.*; import javax.swing.JOptionPane; public class PayStub { // the following variables declared using the final modifiers are // called constants (ie. their values may
import java.util.*; import javax.swing.JOptionPane; public class PayStub { // the following variables declared using the final modifiers are // called constants (ie. their values may not be changed) public static final double FEDERAL_INCOME_TAX = .15; //15% public static final double STATE_TAX = .048; //4.8% public static final double SOCIAL_SECURITY_TAX = .0575; //5.75% public static final double MEDICARE_TAX = .0278; //2.78% public static final double PENSION_PLAN = .05; //5% public static final double HEALTH_PREMIUM = 82.65; //$82.65 //you may use either the following kb Scanner variable //or the JOptionPane class for getting input into the program static Scanner kb = new Scanner(System.in); public static void main(String[] args) { //TO DO: Your code goes here
}
}
Write a program that calculates and outputs the paystub for an employee. Net pay is calculated after taking the following deductions: 1.Federal Income Tax 15.00% 2.State Tax 4.80% 3.Social Security Tax 5.75% 4.Medicare/Medicaid Tax 2.78% 5.Pension Plan 5.00% 6.Health Insurance $82.65 NOTE: All of the above should be declared as constants in your program public static final double FEDERAL_INCOME_TAX = .15; //15% public static final double STATE_TAX = .048; //4.8% public static final double HEALTH_INSURANCE = 82.65; //$82.65 The program will prompt the user running it for an employee name, hours worked, and hourly rate. Please format the Gross Pay and Net Pay amounts to two decimal places. The attached PayStub.java program is a good starting program for this assignment. What the output may look like: What is the Employee name? Jon Claude How many hours did the Employee work? 38.5 What is the Employee's rate of pay? 27.65 Pay Stub for Jon Claude Hours Worked 38.5 Hourly Rate $ 27.65 Gross Pay $ 1064.52 Federal Income Tax 159.67874999999998 State Tax 51.097199999999994 Social Security Tax 61.210187499999996 Medicare Tax 29.593794999999993 Pension Plan 53.22624999999999 Health Care 82.65 Net Pay $ 627.07
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started