Answer:
if ( cash < price )
{
System.out.println("You can't buy the sweater" );
System.out.println("You need $" +
(price-cash)/100 + "." + (price-cash)%100 + " more." );
}
else
System.out.println("You can buy the sweater" );
You (hopefully) picked a relational expression that was true when the user COULD NOT pay for the sweater.
Opposites
In the first program, the boolean expression is:
if ( cash >= price )
because we want the true branch to execute when the user has enough money. In the second program, the boolean expression is:
if ( cash < price )
because we want the false branch to execute when the user has enough money. The operator in the first program includes the "equals". The operator in the second program does not.
In a sense, >= and < are opposite of each other.
Sometimes it is convenient to rearrange the contents of the true and the
false branch. But be sure to change the boolean expression correctly!