created: 12/11/1999; revised 04/16/2010


Fill in the Blanks

Instructions:   This is an ungraded fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. A button represents the missing word(s). For each question, think of the word or phrase that should fill each blank, then click on the buttons to see if you are correct.


1. Select True or False for each operand, then click ? to see the AND of the two operands.

True
False
  AND   True
False
    equals    

2. Select True or False for each operand, then click ? to see the OR of the two operands.

True
False
  OR   True
False
    equals    

3. Select True or False for the operand, then click ? to see the NOT of the operand.

  NOT   True
False
    equals    

4.  In Java, the short-circuit AND operator is

5.   The non-short-circuit AND operator is

6. The short-circuit OR operator is

7. The non-short-circuit OR operator is

8. The NOT operator is


9.  Examine the following sets of operators:

! (unary)- 
*   /
+  -
<   <=  >  >= 
==  !=
&&   ||
Which operators have the HIGHEST precedence?
Which operators have the LOWEST precedence? .


10.  In the following expression, which operator is done first: 4+7*3 < 12 .

11.   1+2 > 5-2 && 12 < 23     evaluates to   .

12.   1+2 > 4-2 || Math.sin(1.5) >= Math.cos(0.34)     evaluates to   . Hint: you don't need a calculator for this!

13.   1+1 > 4-2 && 12 < 23 && 'a' == 'a'     evaluates to   .

14.   1 > 4-2 || 23 > 13 && 8 < 10     evaluates to   .

15.   (9 <= 34 || 5 > 25 ) && 7 < 20     evaluates to   .

16.   9 <= 34 || 5 > 25 && 7 < 20     evaluates to   .

17.   9 <= 34 && 5 > 25 || 7 < 20     evaluates to   .

18.   9 <= 34 && 5 > 25 && 7 < 20     evaluates to   .

19.   9 <= 34 || 5 > 25 || 7 < 20     evaluates to   .

20.   9 >  34 || 5 > 25 || 7 > 20     evaluates to   .



End of the Exercise. If you want to do it again, click on "Refresh" in your browser window.

Click here to go back to the main menu.