Connecting Tech Pros Worldwide Forums | Help | Site Map

Symbol Variable/Class

Newbie
 
Join Date: Oct 2007
Location: Japan
Posts: 6
#1: Oct 6 '07
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.print("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?

Member
 
Join Date: Sep 2007
Location: UK
Posts: 40
#2: Oct 6 '07

re: Symbol Variable/Class


Quote:

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.print("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:
Expand|Select|Wrap|Line Numbers
  1. 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
Reply