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.

Subtopic: Boolean Expressions Clear filter

Questions 291–300 of 357
  1. 291
  2. 292
  3. 293
  4. 294
  5. 295
  6. 296
  7. 297
  8. 298
  9. 299
  10. 300

Question 291

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 292

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 293

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 294

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 295

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 296

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 297

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 298

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 299

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 300

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 291 of 357
Page 30 of 36