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,371–2,380 of 2,811
  1. 2371
  2. 2372
  3. 2373
  4. 2374
  5. 2375
  6. 2376
  7. 2377
  8. 2378
  9. 2379
  10. 2380

Question 2371

Multiple choice Unit 4: Data Collections
The following incomplete method is intended to sort the array a in ascending order. public void sort() { int maxCompare = a.length - 1; int lIndex = 0; int temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2372

Multiple choice Unit 4: Data Collections
Given the following method, what would the result be when m is executed? public void m(int[][] p) { int height = p.length; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2373

Multiple choice Unit 4: Data Collections
What is the output from mystery(4321) when mystery is defined as follows? // preconditions: x >= 0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2374

Multiple choice Unit 4: Data Collections
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2375

Multiple choice Unit 4: Data Collections
Consider the following code segment: public static boolean check(String s) { return s.length() >= 2 && (s.substring(0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2376

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 2377

Multiple choice Unit 4: Data Collections
A two-dimensional array is used to represent a matrix. The declaration is below: private int[][] matrix = new int[2][3]; public static void changeMatrix(int[][]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2378

Multiple choice Unit 4: Data Collections
What is printed when the following main method is executed? public class Searcher { private int[] arr = {1, 3, 5, 8, 9}; public int mystery(int low, int high,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2379

Multiple choice Unit 4: Data Collections
Consider the following method. What value is returned from a call of mystery(5)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2380

Multiple choice Unit 4: Data Collections
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,371 of 2,811
Page 238 of 282