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.

Subtopic: Iteration Clear filter

Questions 271–280 of 383
  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
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 272

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 273

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 274

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 275

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 276

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 277

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 278

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 279

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 280

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 271 of 383
Page 28 of 39