Answer:

if ( value == 399 )
  System.out.println("Correct Value");
else
  System.out.println("Wrong Value");

Equivalent Relational Expressions

In the following, X and Y represent numbers that can be compared.

ComparisonEquivalent ComparisonEquivalent
!(X < Y)X >= Y   !(X >= Y) X < Y
!(X > Y)X <= Y   !(X <= Y) X > Y
!(X == Y)X != Y   !(X != Y) X == Y

Usually if you have a comparison that uses a NOT operator, replace it with an equivalent comparison that does not use a NOT.

QUESTION 12:

Rewrite the following if statement:

if ( !(car.price > 8000 ) )
  System.out.println("Affordable");
else
  System.out.println("Too Expensive!");