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: Iteration Clear filter

Questions 71–80 of 376
  1. 71
  2. 72
  3. 73
  4. 74
  5. 75
  6. 76
  7. 77
  8. 78
  9. 79
  10. 80

Question 71

Multiple choice Iteration
Which of the following code segments will print exactly eight "$" symbols? I. for (int i = 0; i < 8; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 72

Multiple choice Iteration
Consider the following code segment. int a = /* value supplied within program */ int b = /* value supplied within program */ if (/* missing condition */) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 73

Multiple choice Iteration
Consider the following code segment. int n = 0 ; while ( n < 20) { System.out.print(n % 4 + " " ) ; if (…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 74

Multiple choice Iteration
Consider the following method. public int someMethod(int val) { for (int i = 2; i < 7; i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 75

Multiple choice Iteration
Consider the following code segment. for (int h = 2; h <= 6; h += 2) { for (int k = 30; k > 0; k -= 10) { System.out.print(h + k + " "); } } Consider these…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 76

Multiple choice Iteration
Consider the following code segment. for (int h = 5; h >= 0; h = h - 2) { for (int k = 0; k < 3; k++) { if ((h…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 77

Multiple choice Iteration
Consider the following code segment. int number = Integer.MAX_VALUE; while (number > 0) { number = number / 2; } for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 78

Multiple choice Iteration
Consider the following code segment. int value = 33; boolean calculate = true; while (value > 5 || calculate) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 79

Multiple choice Iteration
Consider the following code segment. for (int k = 0; k < 20; k = k + 2) { if (k % 3 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 80

Multiple choice Iteration
Consider the following output. 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 71 of 376
Page 8 of 38