The exercise below use Java. For AP CSP Pseudocode, see Boolean expression practice in AP CSP Pseudocode.
Exercise 1
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
false |
false |
false |
true |
false |
true |
false |
true |
true |
true |
true |
false |
Which of the following expressions is equivalent to the value of the expression shown in the table?
(A) (a && b) || (!a && !b)
(B) (a || b) && (!a || !b)
(C) (a || !b) && (b || !a)
(D) (a || !b) || (b || !a)
Exercise 2
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
true |
true |
false |
true |
false |
true |
false |
true |
false |
false |
false |
false |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) a && b
(B) a && !b
(C) !(!a || b)
(D) !(a && b)
Exercise 3
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
true |
true |
true |
true |
false |
false |
false |
true |
true |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) !(a && b)
(B) !(a || b)
(C) !(a && !b)
(D) !a || b
Exercise 4
The following table shows the value of an expression based on the values of a, b, and c.
Value of a |
Value of b |
Value of c |
Value of expression |
---|---|---|---|
true |
true |
true |
false |
true |
true |
false |
true |
true |
false |
true |
true |
true |
false |
false |
true |
false |
true |
true |
true |
false |
true |
false |
true |
false |
false |
true |
true |
false |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) !a || !b || !c
(B) !(a || b || c)
(C) !(a && b && c)
(D) !a && !b && !c
Exercise 5
The following table shows the value of an expression based on the values of a
, b
, and c
.
Value of a |
Value of b |
Value of c |
Value of expression |
---|---|---|---|
true |
true |
true |
false |
true |
true |
false |
false |
true |
false |
true |
false |
true |
false |
false |
false |
false |
true |
true |
false |
false |
true |
false |
false |
false |
false |
true |
false |
false |
false |
false |
true |
Which of the following expressions are equivalent to the value of the expression shown in the table?
Select TWO answers.
(A) !a && !b && !c
(B) !(a || b || c)
(C) !a || !b || c
(D) !(a && b && c)
Additional resources
Help & comments
Get help from AP CS Tutor Brandon Horn