View Single Post
Old 09-19-2006, 03:35 PM   #2 (permalink)
jaeusm
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

1) Each of your 'if' statements should be lower case letters only.
2) Typically, 'else if' statements are written on one line.
3) "and" is not a keyword in Java -- it is the reason for your error message. Instead of using the english word for 'and', this is the symbol you should use: &&. So your code should look like this:

Code:
if (packages >= 0 && packages <= 9)
Notice: you must use the actual variable name for each comparison.

Code:
// this is wrong and will not compile!!
if (packages >= 0 && <= 9)

// this is correct
if (packages >= 0 && packages <= 9)
There could be more errors, but these I caught at a quick glance.
jaeusm is offline