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 671–680 of 740
  1. 671
  2. 672
  3. 673
  4. 674
  5. 675
  6. 676
  7. 677
  8. 678
  9. 679
  10. 680

Question 671

Multiple choice Iteration
Which offered initial int value of step makes the body execute exactly three…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 672

Multiple choice Iteration
Both versions start with int x = 0 and int y = 9. Version I uses && as shown. Version II replaces only && with ||.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 673

Multiple choice Iteration
What is printed? int hits = 0; for (int divisor = 2; divisor <= 6; divisor++) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 674

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 675

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 676

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 677

Multiple choice Iteration
What is printed? int running = 0; int total = 0; for (int k = 1; k <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 678

Multiple choice Iteration
The ints low and high satisfy 1 <= low <= high <= 8. Which replacement makes found true exactly when at least one multiple…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 679

Multiple choice Iteration
What is printed? int balance = 7; int fee = 1; while (balance >= fee) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 680

Multiple choice Iteration
What is printed? int x = 7; int total = 0; while (x > 3) { total += x;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 671 of 740
Page 68 of 74