Results 1 to 4 of 4
  1. #1
    omutaoka is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default 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);

    System.out.println("\nPlease enter Employee Name: ");
    input = stdin.readline();

    System.out.println("\nPlease enter Pay Rate: ");
    input = stdin.readline();
    figure.rateHour = integer.parseInt(input);

    System.out.println("\Please enter Hours Worked ");
    input = stdin.readline();
    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
    return total;
    }

    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");

    }
    }

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    Double posted from here.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  4. #4
    kulangotski is offline Senior Member
    Join Date
    Feb 2009
    Posts
    117
    Rep Power
    0

Similar Threads

  1. HELP ON errors occuring in the code
    By jaiminparikh in forum Advanced Java
    Replies: 6
    Last Post: 02-12-2009, 03:02 PM
  2. 2 errors with Scanner , help
    By enghar in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 04:03 AM
  3. help with these errors
    By oceansdepth in forum New To Java
    Replies: 3
    Last Post: 04-16-2008, 05:55 PM
  4. Errors in constructor
    By ai_2007 in forum Advanced Java
    Replies: 0
    Last Post: 07-01-2007, 06:35 PM

Posting Permissions

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