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 811–820 of 2,811
  1. 811
  2. 812
  3. 813
  4. 814
  5. 815
  6. 816
  7. 817
  8. 818
  9. 819
  10. 820

Question 811

Multiple choice Unit 2: Selection and Iteration
The following fragment intends that a user will enter a list of positive integers at the keyboard and terminate the list with a sentinel. int value = 0; final…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 812

Multiple choice Unit 2: Selection and Iteration
Consider this code segment. int x = 10, y = 0; while (x > 5) { y = 3; while (y < x) { y *= 2; if (y % x == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 813

Multiple choice Unit 2: Selection and Iteration
What output will be produced by this code segment? (Ignore spacing.) for (int i = 5; i >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 814

Multiple choice Unit 2: Selection and Iteration
Consider this program segment. int newNum = 0, temp; int num = k; //k is some predefined integer value ≥ 0 while (num > 10) { temp = num % 10; num /= 10; newNum…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 815

Multiple choice Unit 2: Selection and Iteration
Consider the method reverse. /** Returns n with its digits reversed. * - Example: If n = 234, method reverse returns 432. * - Precondition: n > 0. */ int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 816

Multiple choice Unit 2: Selection and Iteration
Consider the following output: 0 1 0 2 4 0 3 6 9 0 4 8 12 16 Which of the following code segments will produce this output? (A) for (int x = 1; x < 5; x++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 817

Multiple choice Unit 2: Selection and Iteration
The speed limit of a stretch of highway is 55 miles per hour (mph). The highway patrol issues speeding tickets to anyone caught going faster than 55 miles per…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 818

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: while ((x > y) || y >= z) { System.out.print("*"); } In the code segment above,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 819

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int a = 0; for (int i = 0; i < 10; i++) { for (int k = 0; k <= 5; k++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 820

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int count = 1; int value = 31; while (value >= 10) { value = value -…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 811 of 2,811
Page 82 of 282