Symbol Variable/Class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Levar
    New Member
    • Oct 2007
    • 6

    Symbol Variable/Class

    If I have this in my program:

    Scanner key = new Scanner(System. in);
    DecimalFormat twoDec = new DecimalFormat(" $0.00");
    Taxable income = 0.0; (line 22)
    Tax payable = 0.0; (line 23)
    System.out.prin t("Enter Taxable income ($): \t");
    Taxable income = Key.nextDouble( ); (line 25)
    if (income < 1.00)


    but when I run the program I get an output of this:

    cannot find symbol class Taxable (line 22)

    incompatible types (line 23)

    cannot find symbol class Taxable (line 25)

    cannot find symbol variable Key (line 25)


    Can anyone help?
  • stack
    New Member
    • Sep 2007
    • 40

    #2
    Originally posted by Levar
    If I have this in my program:

    Scanner key = new Scanner(System. in);
    DecimalFormat twoDec = new DecimalFormat(" $0.00");
    Taxable income = 0.0; (line 22)
    Tax payable = 0.0; (line 23)
    System.out.prin t("Enter Taxable income ($): \t");
    Taxable income = Key.nextDouble( ); (line 25)
    if (income < 1.00)


    but when I run the program I get an output of this:

    cannot find symbol class Taxable (line 22)

    incompatible types (line 23)

    cannot find symbol class Taxable (line 25)

    cannot find symbol variable Key (line 25)


    Can anyone help?

    You can't declare variables with spaces!
    Do this instead:
    Code:
    taxableIncome = 0;
    .
    And also don't use capitals for variables because
    it's confusing (the compiler accepts it but don't do it).

    Cheers,
    stack

    Comment

    Working...