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

• 03-03-2009, 09:31 PM
omutaoka
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");

}
}
• 03-03-2009, 09:43 PM
pbrockway2
Double posted from here.
• 03-03-2009, 10:13 PM
Fubarable
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.
• 03-03-2009, 10:48 PM
kulangotski
thats right
true, thats what you have to do