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 211–220 of 692
  1. 211
  2. 212
  3. 213
  4. 214
  5. 215
  6. 216
  7. 217
  8. 218
  9. 219
  10. 220

Question 211

Multiple choice Iteration
Consider the following code segment: for (int i = 0; i = 1; j--)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 212

Multiple choice Boolean Expressions
Consider the following Boolean expression where a and b are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 213

Multiple choice Iteration
Consider the following code segment: int p = 5; int q = 2; int sum = 0; while (p <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 214

Multiple choice Boolean Expressions
Consider the following method: public static void conditionTest(int num1, int num2) { if ((num1 > 0) && (num2 > 0)) { if (num1 > num2) System.out.println("A");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 215

Multiple choice Iteration
Consider the following two code blocks where count and n are both integer values: // Code block I for (count = 0; count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 216

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 217

Multiple choice Boolean Expressions
Given the Boolean expression: (x == y && !(x == y)) || (x != y && !(x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 218

Multiple choice Boolean Expressions
Consider the following code segment. Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 219

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 220

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 211 of 692
Page 22 of 70