Re: If statement problems
Combine the operators. See Equality, Relational, and Conditional Operators . If you get stuck along the way I'd recommend posting code with a defined question to get a quicker and more precise response.
Re: If statement problems
Quote:
Originally Posted by
SnarkKnuckle
However Theres a range for normal and overweight, ranges 18.5 - 24.9 and 25 - 29.9 for overweight. How would I create the relational operator on a range of values such as these to print the proper result?
here's an example for you
Code :
if ( myVariable >= 20 && myVariable <=30 ){
System.out.println("you failed" );
}else if ( .......... ){
...........
}