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 491–500 of 692
  1. 491
  2. 492
  3. 493
  4. 494
  5. 495
  6. 496
  7. 497
  8. 498
  9. 499
  10. 500

Question 491

Multiple choice Boolean Expressions
The int variables x and y and the boolean variable active are initialized. Which condition selects…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 492

Multiple choice Boolean Expressions
The int variables a and b are initialized. Which offered initial pair (a, b) makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 493

Multiple choice Boolean Expressions
The int variable score and the boolean variable extra are initialized. A programmer replaces the original condition with the proposed condition, keeping both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 494

Multiple choice Boolean Expressions
What happens when this code runs? int denominator = 0; if (denominator == 0) { denominator = 3; } else { denominator +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 495

Multiple choice Boolean Expressions
What is printed? int points = 7; int credits = 2; if (credits…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 496

Multiple choice Boolean Expressions
What is printed? int value = 6; if (value < 10) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 497

Multiple choice Boolean Expressions
What is printed? int left = 4; int right = 9; boolean copyRight = false; if (copyRight) { left =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 498

Multiple choice Boolean Expressions
The boolean variable enabled is initialized. Which single statement can replace the entire code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 499

Multiple choice Boolean Expressions
What is printed? int fee = 8; boolean member = false; if (member) { fee =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 500

Multiple choice Boolean Expressions
An int variable n initially has a value from 0 through 8 inclusive. Which list contains all initial values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 491 of 692
Page 50 of 70