Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 871–880 of 2,811
  1. 871
  2. 872
  3. 873
  4. 874
  5. 875
  6. 876
  7. 877
  8. 878
  9. 879
  10. 880

Question 871

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int n = 1, d = 1, s = 1; while (n <= 5) { System.out.print(s +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 872

Multiple choice Unit 2: Selection and Iteration
Assume that the boolean variables a, b, and c have been properly declared and initialized. Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 873

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int num = 5; while (num >= 0) { num -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 874

Multiple choice Unit 2: Selection and Iteration
I. int i = 1; while (i II. for (int i = 0; i < 5; i++) { System.out.print(2*i + 1); } III. for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 875

Multiple choice Unit 2: Selection and Iteration
Consider the following expressions, where x and y are boolean variables with different values: I. (x || y) && (!x ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 876

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = <integer value>, y = <another integer value>; while (x > y && x % y != 0) { x -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 877

Multiple choice Unit 2: Selection and Iteration
What is printed when the following code segment is executed? int sum = 0, d = -1; for (int count =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 878

Multiple choice Unit 2: Selection and Iteration
Consider the following method: private double compute(int x, int y) { double r = 0; if (!(y == 0 || x / y <= 2)) { r = 1 /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 879

Multiple choice Unit 2: Selection and Iteration
Consider the following method: /* * Returns the number of times the digit d occurs in the decimal representation of * Precondition: n and d are non-negative…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 880

Multiple choice Unit 2: Selection and Iteration
When is the following Boolean expression…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 871 of 2,811
Page 88 of 282