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 511–520 of 740
  1. 511
  2. 512
  3. 513
  4. 514
  5. 515
  6. 516
  7. 517
  8. 518
  9. 519
  10. 520

Question 511

Multiple choice Boolean Expressions
An integer score is eligible when it is from 60 through 100 inclusive, except…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 512

Multiple choice Boolean Expressions
For integer x from 0 through 12 inclusive, how many values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 513

Multiple choice Boolean Expressions
A positive integer n earns a bonus when it is divisible by 3 or by 5, but not by both. Values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 514

Multiple choice Boolean Expressions
What is printed? int a = 8; int b = 3; boolean first = a / b == 2 || a % b == 0 && a < b;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 515

Multiple choice Boolean Expressions
The int variables n and d satisfy -20 <= n <= 20 and -5 <= d <= 5. A result must be true exactly when d is positive and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 516

Multiple choice Boolean Expressions
What happens when this code runs? int divisor = 0; int total = 12; boolean ready = false;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 517

Multiple choice Boolean Expressions
What happens when this code runs? int total = 9; int group = 3; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 518

Multiple choice Boolean Expressions
Each offered value replaces the comment in a separate run. Which value causes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 519

Multiple choice Boolean Expressions
What happens when this code runs? int zero = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 520

Multiple choice Boolean Expressions
The int variables amount and divisor satisfy 0 <= amount <= 30 and 0 <= divisor <= 10. The expression below is safe. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 511 of 740
Page 52 of 74