logo Practice-It logo

BJP3 Self-Check 5.14: logicExpressions2

Language/Type: Java boolean logic expressions
Author: Leslie Ferguson (on 2013/04/01)

Given the following variable declarations:

int x = 27;
int y = -1;
int z = 32;
boolean b = false;

What is the value of each of the following boolean expressions?

!b
b || true
(x > y) && (y > z)
(x == y) || (x <= z)
!(x % 2 == 0)
(x % 2 != 0) && b
b && !b
b || !b
(x < y) == b
!(x / 2 == 13) || b || (z * 3 == 96)
(z < x) == false
!((x > 0) && (y < 0))

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.