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 271–280 of 376
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Multiple choice Iteration
Which offered int value of n causes the body to execute exactly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Iteration
What is printed? int remaining = 17; int rounds = 0; while (remaining > 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Iteration
What is printed? int count = 0; int i; for (i = 1; i < 10;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Multiple choice Iteration
The int n is from 0 through 12 inclusive. Which expression always equals n immediately before every evaluation of i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Iteration
Each version begins with value = 3, where value is an int. Which offered int limit makes Version II execute its body exactly one…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Iteration
Which offered initial value of the int n makes the loop execute exactly three…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Iteration
What is printed? int total = 0; for (int i = 1; i <= 5; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Iteration
What is printed? int weight = 1; int total = 0; for (int i = 0; i < 4; i++) { total…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Iteration
What is printed? int a = 2; int b = 9; for (int i = 0; i < 2; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Iteration
Each version is placed inside the displayed loop with count initially 0. What are the final counts for Version I and Version II, respectively? for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 376
Page 28 of 38