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 471–480 of 692
  1. 471
  2. 472
  3. 473
  4. 474
  5. 475
  6. 476
  7. 477
  8. 478
  9. 479
  10. 480

Question 471

Multiple choice Boolean Expressions
What happens when this code runs? int zero = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 472

Multiple choice Boolean Expressions
The int variables amount and divisor satisfy 0 <= amount <= 30 and 0 <= divisor <= 10. The expression below is safe. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 473

Multiple choice Boolean Expressions
What happens when this code runs? int p = 5; int q = 2; boolean result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 474

Multiple choice Boolean Expressions
What is printed? int a = 10; int b = 4; boolean earlier = a / b == 2; a %= b; b -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 475

Multiple choice Boolean Expressions
What is printed? int n = 13; int d = 5; double first = (double) (n / d); double second =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 476

Multiple choice Boolean Expressions
The variable n has type int. Which offered value makes the entire…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 477

Multiple choice Boolean Expressions
What is printed? double reading = -7.8; int whole = (int) reading; int half = (int) (reading / 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 478

Multiple choice Boolean Expressions
The int variables completed and total satisfy 0 <= completed <= total and 1 <= total <= 1000. A task is sufficiently…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 479

Multiple choice Boolean Expressions
What happens when this code runs? int numerator = 9; int divisor = 2 / 3; boolean valid = divisor >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 480

Multiple choice Boolean Expressions
What is printed? int total = 6; int group = 2; total /= group; group -= total; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 471 of 692
Page 48 of 70