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 561–570 of 740
  1. 561
  2. 562
  3. 563
  4. 564
  5. 565
  6. 566
  7. 567
  8. 568
  9. 569
  10. 570

Question 561

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 562

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 563

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 564

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 565

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 566

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 567

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 568

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 569

Multiple choice Boolean Expressions
The int variables x and y are initialized. Which statement describes their final…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 570

Multiple choice Boolean Expressions
The boolean variables p, q and r are initialized. Which offered initial triple (p, q, r) makes all…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 561 of 740
Page 57 of 74