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 311–320 of 383
  1. 311
  2. 312
  3. 313
  4. 314
  5. 315
  6. 316
  7. 317
  8. 318
  9. 319
  10. 320

Question 311

Multiple choice Iteration
What is printed? int row = 1; int col = 0; boolean found = false; while (row <= 4 && !found) { col = 1; while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 312

Multiple choice Iteration
What is printed? int value = 17; for (int round = 0; round <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 313

Multiple choice Iteration
What is printed? int n = 19; int total = 0; while (n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 314

Multiple choice Iteration
What is printed? int value = 20; for (int divisor = 2; divisor…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 315

Multiple choice Iteration
What is printed? boolean add = true; int score = 0; for (int i = 1; i <= 4; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 316

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 317

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 318

Multiple choice Iteration
What is printed? double a = 0; double b = 0; for (int k = 1; k <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 319

Multiple choice Iteration
Which offered initial int value of x makes the final value…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 320

Multiple choice Iteration
What is printed? int number = 893; int score = 0; while (number > 0) { int digit…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 311 of 383
Page 32 of 39