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 631–640 of 740
  1. 631
  2. 632
  3. 633
  4. 634
  5. 635
  6. 636
  7. 637
  8. 638
  9. 639
  10. 640

Question 631

Multiple choice Iteration
The int n is from 0 through 12 inclusive. Which expression always equals n immediately before every evaluation of i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 632

Multiple choice Iteration
Each version begins with value = 3, where value is an int. Which offered int limit makes Version II execute its body exactly one…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 633

Multiple choice Iteration
Which offered initial value of the int n makes the loop execute exactly three…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 634

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 635

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 636

Multiple choice Iteration
What is printed? int a = 2; int b = 9; for (int i = 0; i < 2; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 637

Multiple choice Iteration
Each version is placed inside the displayed loop with count initially 0. What are the final counts for Version I and Version II, respectively? for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 638

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 639

Multiple choice Iteration
Which initialization makes product equal to 24 after the loop? int product =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 640

Multiple choice Iteration
Which offered int value of target causes exactly four body executions? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 631 of 740
Page 64 of 74