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 601–610 of 692
  1. 601
  2. 602
  3. 603
  4. 604
  5. 605
  6. 606
  7. 607
  8. 608
  9. 609
  10. 610

Question 601

Multiple choice Iteration
Across the entire code segment, how many times is col < 2 evaluated? for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 602

Multiple choice Iteration
What is printed? int count = 0; int row; for (row = 0; row < 4; row++) { for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 603

Multiple choice Iteration
What is printed? int count = 0; for (int r = 1; r <= 4; r++) { for (int c =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 604

Multiple choice Iteration
The original loop prints six coordinate pairs. Which replacement for the comment inside the single loop makes it print exactly the same sequence? // Original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 605

Multiple choice Iteration
Which replacement produces the same final values of both total and i as the original? Each version…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 606

Multiple choice Iteration
For every int n from 0 through 10 inclusive, which replacement leaves total equal to the original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 607

Multiple choice Iteration
The code is intended to sum all positive odd integers less than or equal to n. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 608

Multiple choice Iteration
For every int n from 1 through 6 inclusive, the code should count all executions of the inner body. Which single edit fixes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 609

Multiple choice Iteration
Which statement describes the code? int x = 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 610

Multiple choice Iteration
Which replacement makes count equal to the number of integer divisions by 2 needed for a positive x to become 0? The original x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 601 of 692
Page 61 of 70