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 111–120 of 376
  1. 111
  2. 112
  3. 113
  4. 114
  5. 115
  6. 116
  7. 117
  8. 118
  9. 119
  10. 120

Question 111

Multiple choice Iteration
Consider the following code segment: int a = 8, b = 3, temp = 0; for (int i = 1; i < 6; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 112

Multiple choice Iteration
Consider the following code segment: What is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 113

Multiple choice Iteration
Consider the following code segment. int count = 5; for (int i = 3; i < 7; i = i + 2) { count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 114

Multiple choice Iteration
Consider the following code segment. int val1 = 2, val2 = 22, val3 = 78; while (val2 % val1 == 0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 115

Multiple choice Iteration
What will be the output when the following code is evaluated? for (int k = 0; k < 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 116

Multiple choice Iteration
Consider the following code fragments. Assume someNum has been correctly defined and initialized as a positive integer. I. int i; for (i = 0; i < someNum; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 117

Multiple choice Iteration
Consider the following code segment: for (int i = 1; i < 100; i = i * 2) { if (i / 50 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 118

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 119

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 120

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 111 of 376
Page 12 of 38