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 2,391–2,400 of 2,811
  1. 2391
  2. 2392
  3. 2393
  4. 2394
  5. 2395
  6. 2396
  7. 2397
  8. 2398
  9. 2399
  10. 2400

Question 2391

Multiple choice Unit 4: Data Collections
Given the following method: boolean temp = false; int count = 0; for (int testval : a) { if (testval == val) count++; } temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2392

Multiple choice Unit 4: Data Collections
Given the following partial implementation of a sorting algorithm: public static void sort(int[] a) { int maxCompare = a.length - 1; int savedIndex = 0; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2393

Multiple choice Unit 4: Data Collections
Given the following 2D array declaration and initialization: int[][] matrix = {{-1, -2, 3}, {4, -5, 6}}; And the method: public static void changeMatrix(int[][]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2394

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static int mystery(int n) { if (n == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2395

Multiple choice Unit 4: Data Collections
Given the initial array: {6, 3, 8, 5, 1} Which of the following correctly shows…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2396

Multiple choice Unit 4: Data Collections
Given the following recursive method: public static int mystery(String str) { if (str.length() == 0) return 0; else { if (str.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2397

Multiple choice Unit 4: Data Collections
Which scenario will cause the longest execution time for a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2398

Multiple choice Unit 4: Data Collections
Consider the following code segment: public static void test(int[] a, int y) { if (a.length > 1) { a[1] = a[1] * 2; y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2399

Multiple choice Unit 4: Data Collections
Which of the following is (are) true? I. Insertion sort takes longer when the array is sorted in ascending order and you want it sorted in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2400

Multiple choice Unit 4: Data Collections
Consider the following code segment: private int[] arr; public int mystery(int low, int high, int num) { int mid = (low + high) / 2; if (low > high) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,391 of 2,811
Page 240 of 282