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 1,831–1,840 of 2,811
  1. 1831
  2. 1832
  3. 1833
  4. 1834
  5. 1835
  6. 1836
  7. 1837
  8. 1838
  9. 1839
  10. 1840

Question 1831

Multiple choice Unit 4: Data Collections
What does the following code snippet check for? int[] numbers = {1, 2, 3, 3, 4, 5}; boolean mysteryBoolean = false; for (int i = 0;i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1832

Multiple choice Unit 4: Data Collections
What does the following code snippet do? int[] scores = {80, 92, 91, 68, 88}; int sum = 0; for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1833

Multiple choice Unit 4: Data Collections
What is the output after this code snippet runs? int[] scores = {80, 92, 91, 68, 88};…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1834

Multiple choice Unit 4: Data Collections
Which of the following code snippets gets the THIRD element in the scores array and assigns it to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1835

Multiple choice Unit 4: Data Collections
Which of these methods will properly traverse two ArrayLists…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1836

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<String> words = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1837

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[] nums = new int[51]; for (int k = 0; k < nums.length; k++) nums[k] = 1; for (int k = 3; k <= 50; k += 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1838

Multiple choice Unit 4: Data Collections
Consider the following method with two missing statements. /** Returns the sum of all positive odd values * among the first n elements of arr. * Precondition: 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1839

Multiple choice Unit 4: Data Collections
public void process(int[] a) { for (int i = 1; i < a.length; i++) // Line 1 { int current = a[i]; // Line 2 int j = 0; // Line 3 while (a[j] < current) // Line…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1840

Multiple choice Unit 4: Data Collections
public void process(int[] a) { for (int i = 1; i < a.length; i++) // Line 1 { int current = a[i]; // Line 2 int j = 0; // Line 3 while (a[j] < current) // Line…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,831 of 2,811
Page 184 of 282