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 721–730 of 740
  1. 721
  2. 722
  3. 723
  4. 724
  5. 725
  6. 726
  7. 727
  8. 728
  9. 729
  10. 730

Question 721

Multiple choice Iteration
What is printed as a result of executing the following code segment? int n = 1; boolean found =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 722

Multiple choice Iteration
What is printed as a result of executing the following code segment? int a =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 723

Multiple choice Iteration
What is printed as a result of executing the following code segment? int a = 1, b = 1, c…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 724

Multiple choice Iteration
What is printed as a result of executing the following code segment? int count = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 725

Multiple choice Iteration
What is printed as a result of executing the following code segment? for (int i = 1; i <= 4; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 726

Multiple choice Iteration
What is printed as a result of executing the following code segment? int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 727

Multiple choice Iteration
What is printed as a result of executing the following code segment? for (int i = 3; i >= 1; i--) { for (int j = 0; j…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 728

Multiple choice Iteration
What is printed as a result of executing the following code segment? int max = 0; for (int i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 729

Multiple choice Iteration
For every int n from 0 through 6 inclusive, which statement in the replacement loop preserves the final value of sum? Each version starts with int sum = 0;. //…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 730

Multiple choice Iteration
Each version begins with int a = 3; and int b = 2;. For every int n from 0 through 8 inclusive, which replacement body preserves…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 721 of 740
Page 73 of 74