Is it possible to use relational operators in the case: section of a Java switch
eg
switch (guess)
case (>number):…
etc
I know the above doesn’t work, but that’s the sort of thing I need. I need to compare the variable in the switch (guess) with a computer generated random number, and report whether the guess is too high, too low, or correct (it’s a simple guessing game…pick a number between 1 and 1000 etc).
Thanks,
M.R.Chambers