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 701–710 of 740
  1. 701
  2. 702
  3. 703
  4. 704
  5. 705
  6. 706
  7. 707
  8. 708
  9. 709
  10. 710

Question 701

Multiple choice Iteration
What happens when this code executes? int x = 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 702

Multiple choice Iteration
Each version begins with int x = 2 and int y = 1. For every int n from 0 through 8 inclusive, which replacement body preserves both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 703

Multiple choice Iteration
For every int n from 0 through 6 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 704

Multiple choice Iteration
What is printed as a result of executing the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 705

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 706

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 707

Multiple choice Iteration
What is printed as a result of executing the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 708

Multiple choice Boolean Expressions
What is printed as a result of executing the following code segment? int score = 85; String g = ""; if (score >= 90) g +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 709

Multiple choice Boolean Expressions
What is printed as a result of executing the following code segment? int x = 5, y = 8; if (x > 3) { if (y < 5) { System.out.print("A"); }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 710

Multiple choice Boolean Expressions
What is printed as a result of executing the following code segment? int n = 4; if (n >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 701 of 740
Page 71 of 74