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 681–690 of 740
  1. 681
  2. 682
  3. 683
  4. 684
  5. 685
  6. 686
  7. 687
  8. 688
  9. 689
  10. 690

Question 681

Multiple choice Iteration
Which offered int value of stop makes the final code equal to 120? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 682

Multiple choice Iteration
For every int n from 0 through 8 inclusive, total should equal 1*2 + 2*3 + ... + n*(n+1), with result 0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 683

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 684

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 685

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 686

Multiple choice Iteration
For every int n from 0 through 8 inclusive, which statement in the replacement loop preserves the final total? Each version starts with total = 0. // Original…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 687

Multiple choice Iteration
For every int n from 1 through 8 inclusive, which expression equals the final count? int count = 0; for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 688

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 689

Multiple choice Iteration
Version II moves only limit -= row to the start of the outer body, before the inner loop. Each version starts with count = 0 and limit = 5. What are the final…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 690

Multiple choice Iteration
Which output is produced? Spaces inside a line are significant. for (int row = 0; row < 3; row++) { for (int col = 0; col < 5; col++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 681 of 740
Page 69 of 74