Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Practice Questions

Work through AP Computer Science A practice 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 621–630 of 740
  1. 621
  2. 622
  3. 623
  4. 624
  5. 625
  6. 626
  7. 627
  8. 628
  9. 629
  10. 630

Question 621

Multiple choice Iteration
What is printed? int n = 5; while (n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 622

Multiple choice Iteration
What is printed? int x = 8; int count = 0; while (x <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 623

Multiple choice Iteration
How many times is i <= 6 evaluated, and how many times does the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 624

Multiple choice Iteration
What is printed? int i; for (i = 2; i <= 7; i +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 625

Multiple choice Iteration
What is printed? int total = 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 626

Multiple choice Iteration
Each version starts with int n = 3 and int total = 0. What are the final totals for Version I and Version II,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 627

Multiple choice Iteration
The int n is from 0 through 10 inclusive. Which replacement makes total equal to the sum of all integers from 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 628

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 629

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 630

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 621 of 740
Page 63 of 74