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.

Subtopic: Boolean Expressions Clear filter

Questions 251–260 of 316
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

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 252

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 253

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 254

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 255

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 256

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 257

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 258

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 259

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 260

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 251 of 316
Page 26 of 32