Help with JCreator

Discussion in 'School Work Help' started by Elusive, Oct 19, 2011.

  1. Elusive

    Elusive Member

    6
    26
    0
    Can anyone tells what wrongs with the program I am trying to write?



    public class Wages {

    public static void main(String[] args) {

    int hourly_rate = 16;
    int hourly_work_per_day = 8;
    double tax = .20;
    double social_security_tax = .06;

    double totalWagesPlusTaxes;
    double totalNetEarn;

    totalWagesPlusTaxes=hourly_rate*hourly_work_per_day;
    totalNetEarn=totalWagesPlusTaxes-(tax + social_security_tax);

    System.out.println("Hourly Rate :"+hourly_rate+"Dollar");
    System.out.Println("Hourly Works :"+hourly_work_per_day+"Dollar");
    System.out.Println("Taxes :"+tax+"Percent");
    System.out.Println("Social Security Taxes :"+social_security_tax+"Percent");
    System.out.Println("Gross Pay :"+totalWagesPlusTaxes+"Dollar");
    System.out.Println("Net Earn :"+totalNetEarn+"Dollar");




    }
    }
     
  2. mr_evolution

    mr_evolution ( • )( •ԅ(ˆ⌣ˆԅ)

    9,967
    590
    57
    Not sure how different JCreator & Eclipse is but:

    Code:
    totalWagesPlusTaxes=hourly_rate*hourly_work_per_da y;
    should be:
    Code:
    totalWagesPlusTaxes=hourly_rate*hourly_work_per_day;
    (no space in 'day')

    and did

    Code:
    println
    instead of
    Code:
    Println
    Result looked like this:
    Code:
    Hourly Works :8Dollar
    Taxes :0.2Percent
    Social Security Taxes :0.06Percent
    Gross Pay :128.0Dollar
    Net Earn :127.74Dollar
     
  3. Elusive

    Elusive Member

    6
    26
    0
    Thank you so much. I should switch to Eclipse.