I'm taking a Java class and need some help. I need to create a java class tp accepts a users houlry rate of pay and number of hours worked and will display the users groos pay, the withholding tax 15% of gorss pay and netpay (gross pay - withholding)
here is what i have but can get it working.

Any help ?

public class Payroll
public static void main (String [] args)
String name;
int hours;
double rate;
double fedTax;

System.out.print("Enter number of hours worked in a week: ");

System.out.print("Enter hourly pay rate: ");

System.out.print("Enter federal tax withholding rate: ");

double grossPay;

grossPay = rate * hours;

double fedwithHolding;

fedwithHolding = fedTax * grossPay;

double netPay;

netPay = (grossPay) - deduction;

System.out.println("The netpay is " +netPay);

Edited by pyTony: fixed formatting

5 Years
Discussion Span
Last Post by Majestics
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.