AP® Computer Science A Selection and Iteration Multiple Choice Questions
Work through AP Computer Science A multiple-choice questions on Selection and Iteration, then check each answer against a worked solution.
Free · no sign-up Open questions need no account. Sign up or log in to open the rest.
Subtopic: Boolean Expressions Clear filter
Question 182
Consider the following code segment.
boolean a = true;
boolean b = false;
boolean c = true;
boolean value = !(a && b) && (b || c) && !(a && !c);
What value is stored in value?
Main Solution
Answer
Answer: C. !(a && b) is true, (b || c) is true, and !(a && !c) is also true because !c is false.
Answer: Correct: C
A
false, because a && b is false
B
false, because b is false
C
true
D
false, because a is true
Answer images
Question 183
Question 184
Question 185
Question 186
Question 187
Question 188
Question 189
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.

