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 481–490 of 692
  1. 481
  2. 482
  3. 483
  4. 484
  5. 485
  6. 486
  7. 487
  8. 488
  9. 489
  10. 490

Question 481

Multiple choice Boolean Expressions
A request is valid only when used is from 0 through 10 inclusive. Within that range, it is allowed when space remains or…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 482

Multiple choice Boolean Expressions
An int x qualifies when it belongs to exactly one of these inclusive…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 483

Multiple choice Boolean Expressions
The int variables n and d satisfy 0 <= n <= 100 and 1 <= d <= 20.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 484

Multiple choice Boolean Expressions
Each offered initial value is used in a separate run. Which value of stock makes earlier and now different? int stock = /* value */;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 485

Multiple choice Boolean Expressions
Assume 1 <= a <= 100 and 0 <= b <= 100, with both variables of type int. Each expression is evaluated separately. Which expressions are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 486

Multiple choice Boolean Expressions
The int variables used and capacity are each from 0 through 100. A result must be true exactly when capacity is positive, used does not exceed…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 487

Multiple choice Boolean Expressions
The int variables tasks, slots, and reserved satisfy 0 <= tasks <= 100, 0 <= slots <= 20, and 0 <= reserved <= slots. After the declaration below, a plan is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 488

Multiple choice Boolean Expressions
What is printed? boolean raining = true; boolean covered = false; if (!(raining…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 489

Multiple choice Boolean Expressions
The boolean variables member and expired are initialized, and access is declared as int. The two branches are swapped as shown. Which replacement for the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 490

Multiple choice Boolean Expressions
What is printed? boolean p = true; boolean q = false; boolean r = false; int result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 481 of 692
Page 49 of 70