bbb Home
Booleans Contents        

BOOLEAN OPERATORS

 

OPERATOR
SYMBOL
DESCRIPTION
AND
&&
True if both are true
OR
||
True if either true
NOT
!
Makes condition opposite

 


EXAMPLE

Font: 8pt   12pt   20pt   24pt   Width: Min. 50%   75%   100%   

PRACTICE

1.  Given the following:  x = 5, y = 10, z = 20, sName = "bo".  Review each of the following statements and determine if they will evaluate to True or False:
  1. (x < 10)
  2. (x < 10 && y < 10)
  3. (2*x <= y)
  4. !(z != x || z != x)
  5. (x < 5 || y < 5 || z < 5) 
  6. (x*y > y*z && y <= z)
  7. (sName = "bo" || sName = "Bo")
  8. (sName != "x")
  9. ((true && false) || (true || false))

2. Create a function that accepts three parameters - low, high, and number. The function should determine if number is between low and high and return true if so and false if not.

 


SELF-QUIZ