Verityprep
Question Bank · Unit 2

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

Questions 181–190 of 316
  1. 181
  2. 182
  3. 183
  4. 184
  5. 185
  6. 186
  7. 187
  8. 188
  9. 189
  10. 190

Question 181

Multiple choice Boolean Expressions
Consider the following code segment. int x = 3; int y = 8; if (x > 4 && y++ > 7) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 182

Multiple choice Boolean Expressions

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?

Pick an answer, then check it. The solution opens in a window.

Question 183

Multiple choice Boolean Expressions
Consider the following code segment. int x = 4; int y = 9; int z = 2; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 184

Multiple choice Boolean Expressions
Consider the following code segment. int a = 5; int b = 2; int c = 7; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 185

Multiple choice Boolean Expressions
What is printed by the following code segment? int n = 6; if (n % 2 == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 186

Multiple choice Boolean Expressions
What is the value of r after the following code segment is executed? int a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 187

Multiple choice Boolean Expressions
What is printed by the following code segment? int x = 0; int y = 6; if (x != 0 && y / x > 2)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 188

Multiple choice Boolean Expressions
Which of the following is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 189

Multiple choice Boolean Expressions
Consider the following declarations: boolean p = true; boolean q = false; Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 190

Multiple choice Boolean Expressions
What is the value of bonus after the following code segment is executed? int pts = 85; int bonus = 0; if (pts >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 181 of 316
Page 19 of 32