A good answer might be:

The logical expression is true....

34 > 2   ||   5 == 7
------        -----
 true         false
   --------------
       true

....because all OR needs is one true.


Try the Program Yourself

Here is a simulation of the car credit program. The actual program is written in JavaScript, but it works just like the part shown in Java.


How much cash do you have?   

How much credit do you have?  

  if ( cash>=25000 || credit>=25000 )
    System.out.println("Enough to buy this car!");
  else
    System.out.println("Have you considered a Yugo?");
  


Try the program out with various values of cash and credit to check that you understand how OR works.

QUESTION 18:

What does the program do if the user enters negative numbers?