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.

Questions 231–240 of 692
  1. 231
  2. 232
  3. 233
  4. 234
  5. 235
  6. 236
  7. 237
  8. 238
  9. 239
  10. 240

Question 231

Multiple choice Iteration
Consider the following output: 0 1 0 2 4 0 3 6 9 0 4 8 12 16…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 232

Multiple choice Iteration
Consider the following code segment: int x = 10; int y = 3; boolean b = true; for (int i = 0; i < 15; i += 5) { x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 233

Multiple choice Iteration
In the following statement, a and b are boolean variables: boolean c =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 234

Multiple choice Iteration
Consider the following code segment: while ((x > y) || y >= z) { //code not shown } In the code segment above,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 235

Multiple choice Iteration
Consider the following code segment: int x = 10; int y = x / 3; int z = x % 2; x++;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 236

Multiple choice Iteration
Consider the following code segments: I. int x = 10; int y = 20; int z = 0; if (x < y && 10 < y/z) { System.out.println("Homer"); } else {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 237

Multiple choice Boolean Expressions
Given int x = 7 and int y = 3, what is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 238

Multiple choice Iteration
Consider the following code segment: int sum = 0; for (int i = 1; i <= 5; i++) { if (i % 2 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 239

Multiple choice Boolean Expressions
Consider the following boolean expression: !(x > 5 && y < 10) ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 240

Multiple choice Boolean Expressions
Consider the following code segment: int x = 5; int y = 10; boolean result = (x > 7) && (y++ <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 231 of 692
Page 24 of 70