Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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,601–2,610 of 3,140
  1. 2601
  2. 2602
  3. 2603
  4. 2604
  5. 2605
  6. 2606
  7. 2607
  8. 2608
  9. 2609
  10. 2610

Question 2601

Free response Unit 4: Data Collections
This question involves the process of taking a list of words, called wordList, and producing a formatted string of a specified length. The list wordList…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2602

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 2603

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 2604

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 2605

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 2606

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 2607

Multiple choice Unit 4: Data Collections
Given the following method: public static int test(int[] a, int v) { for (int i = 0; i < a.length;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2608

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2609

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 2610

Multiple choice Unit 4: Data Collections
Given the following values for a 2D array m and the following code: 1 1 1 1 1 2 3 4 2 2 2 2 2 4 6 8 int sum = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,601 of 3,140
Page 261 of 314