# Thread: hi,can anyone help with the following code,i could not complie because its got errors

1. Member Join Date
Mar 2009
Posts
2
Rep Power
0

## hi,can anyone help with the following code,i could not complie because its got errors

import java.awt.*;
import java.io.*;
import java.text.DecimalFormat;

public class EmployeeNetPay
{

static final double FICA = 0.0715
static final double FED_TAX = 0.28
static final double STATE_Tax = 0.10

public static void main(string[] args) throws IOException
{
double grossPay,totalDec,netPay;

PayrollSalatr amount = new PayrollSalary();

Getamountfigure(amount);
grossPay = CalculateGrossPay(amount);
totalDec = CalculateTotalDec(grossPay);
netPay = Calculate(grossPay,totalDec);
Print NetSalary(grossPay,totalDec,netPay,amount);
}
static void Getamountfigure(PayrollSalary figure) throws IOException
{
String input;
DataInputStream stdin = new DataInputStream(System.in);

figure.rateHour = integer.parseInt(input);

figure.workedHours = Integer.parseInt(input);
}

static double CalculateGrossPay(amount);
{
double gross;
figure.grossPay = amount.rateHour * amount.workedHours;
return gross;

double total;
figure.totalDec = grossPay * FICA,grossPay *FED_TAX,grossPay * STATE_TAX
}

static double CalculatenetPay(double gross,total);
{

double netPay,totaldec;
totalDec = CalculateGrossPay(gross);

netPay = gross - totalDec;

return netPay;
}

static void Print NetSalary(double gross,double total ,amount)
{

double totalDec;

DecimalFormat df = DecimalFormat("0.00");

class PayrollSalary
{
int rateHour=0,workedHours=0;
double grosspay=0,totalDec=0,netPay=0
}

System.out.println("n\**************");
System.out.println("n\rateHour");
System.out.print("n\workhours");
grossPay = CalculategrossPay(gross);
System.out.println("n\grossPay");
System.out.println("n\totalDec");
System.out.print("n\netPay");

}
}  Reply With Quote

2. Moderator   Join Date
Feb 2009
Location
New Zealand
Posts
4,716
Rep Power
18

## Double posted from here.  Reply With Quote

3. ## Sorry, there are way too many mistakes to fix. I suggest that you throw this code out -- don't even waste time trying to fix it, and start afresh. You should review your text and notes though first as you need to learn or relearn some basics. Also, I recommend that you compile after each line or two of code that you add, and don't add any more code unless the code just added compiles correctly.  Reply With Quote

4. Senior Member Join Date
Feb 2009
Posts
117
Rep Power
0

## thats right

true, thats what you have to do  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•