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 491–500 of 740
  1. 491
  2. 492
  3. 493
  4. 494
  5. 495
  6. 496
  7. 497
  8. 498
  9. 499
  10. 500

Question 491

Multiple choice Iteration
The following code segment is intended to count the integers from 1 to 60, inclusive, that are divisible by 4 but not divisible by 6. Which of the following can…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 492

Multiple choice Iteration
What is printed by the following code segment? int a = 1; int b = 2; for (int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 493

Multiple choice Iteration
What is the value of total after the following code segment is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 494

Multiple choice Iteration
What is the result of compiling and running the following code segment?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 495

Multiple choice Boolean Expressions
What is the value of bonus after the following code segment is executed? int pts = 85; int bonus = 0; if (pts >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 496

Multiple choice Iteration
The following loop terminates normally. Which of the following must be true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 497

Multiple choice Iteration
What is printed by the following code segment? double result = 0; for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 498

Multiple choice Iteration
What is printed by the following code segment? String s = "banana"; int count = 0; for (int i = 0; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 499

Multiple choice Iteration
What is printed by the following code segment? int a = 1; int b =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 500

Multiple choice Iteration
What is printed by the following code segment? for (int i = 3; i >= 1; i--) { for (int j = 1; j <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 491 of 740
Page 50 of 74