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 11–20 of 692
  1. 11
  2. 12
  3. 13
  4. 14
  5. 15
  6. 16
  7. 17
  8. 18
  9. 19
  10. 20

Question 11

Multiple choice Boolean Expressions
Assume that x and y are boolean variables and have been properly initialized. (x && y) &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 12

Multiple choice Iteration
Consider the following code segment. int count = 0; for (int x = 0; x < 4; x++) { for (int y = x; y < 4;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 13

Multiple choice Iteration
Consider the following code segment. int value = 15; while (value < 28) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 14

Multiple choice Boolean Expressions
A teacher put three bonus questions on a test and awarded 5 extra points to anyone who answered all three bonus questions correctly and no extra points…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 15

Multiple choice Iteration
int k = a random number such that 1 ≤ k ≤ n ; for (int p = 2; p <= k; p++) for (int r = 1; r < k;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 16

Multiple choice Boolean Expressions
Assume that x and y are boolean variables and have been properly initialized. (x &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 17

Multiple choice Iteration
Consider the following code segment. int k = 0; while (k < 10) { System.out.print((k % 3) + " ");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 18

Multiple choice Boolean Expressions
Consider the following code segment. int x = /* some integer value */ ; int y = /* some integer value */ ; boolean result = (x < y); result = ( (x >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 19

Multiple choice Iteration
Consider the following code segment. for (int outer = 0; outer < n; outer++) { for (int inner = 0; inner <= outer; inner++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 20

Multiple choice Boolean Expressions
Assume that a and b are variables of type int. The expression !(a < b) && !(a > b)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 11 of 692
Page 2 of 70