Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 692
  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
The int variables a, b and c are initialized. Which condition is true exactly when winner finishes with the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 512

Multiple choice Boolean Expressions
What is printed? int x = 4; int y = 6; if (x < y) { x += 3; if (x < y) { y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 513

Multiple choice Boolean Expressions
Both versions start with the int variable score = 0 and the same boolean values active and bonus. Which offered pair (active, bonus) makes their final scores…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 514

Multiple choice Boolean Expressions
The boolean variables p and q may have any values. Which offered output cannot occur? if (p) { if (q) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 515

Multiple choice Boolean Expressions
An int variable x initially has a value from -3 through 7 inclusive. Which list contains all initial values that make result equal 2? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 516

Multiple choice Boolean Expressions
What is printed? boolean a = true; boolean b = false; if (a) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 517

Multiple choice Boolean Expressions
What is printed? int x = -8; if (x < 0) { x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 518

Multiple choice Boolean Expressions
The int variable x initially lies from -8 through 8 inclusive. A programmer changes the second if into else if, leaving both bodies unchanged. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 519

Multiple choice Boolean Expressions
Each version starts with the same int value x. Which offered initial value makes the two versions finish with different…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 520

Multiple choice Boolean Expressions
An int variable x initially lies from 0 through 20 inclusive. Which list contains all initial…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 511 of 692
Page 52 of 70