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,821–2,830 of 3,140
  1. 2821
  2. 2822
  3. 2823
  4. 2824
  5. 2825
  6. 2826
  7. 2827
  8. 2828
  9. 2829
  10. 2830

Question 2821

Free response Unit 4: Data Collections
GPSRouter stores routes in an initialized ArrayList routes. Route provides String getName(), int getMiles(), and void setMiles(int num). The provided…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2822

Free response Unit 4: Data Collections
The High School Coin Collection Club needs new software to help organize its coin collections. Each coin in the collection is represented by an object of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2823

Multiple choice Unit 4: Data Collections
What is the output of this code? ArrayList<String> words = new ArrayList<>();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2824

Multiple choice Unit 4: Data Collections
What is the value of sum after the following executes? int[][] grid = { {1, 2, 3}, {4, 5,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2825

Multiple choice Unit 4: Data Collections
Consider traversing an ArrayList while removing elements. Which approach avoids skipping elements? // Approach I – forward traversal for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2826

Multiple choice Unit 4: Data Collections
Consider the following method: public static int[] doubleArray(int[] arr) { int[] result = new int[arr.length]; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2827

Multiple choice Unit 4: Data Collections
What is the output of the following code? int[] arr = {5, 3, 8, 1, 9}; int result = arr[0]; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2828

Multiple choice Unit 4: Data Collections
Consider the following: ArrayList<Integer> list = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2829

Multiple choice Unit 4: Data Collections
What does the following method return for input [[1,2],[3,4],[5,6]]? public static int colSum(int[][] m, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2830

Multiple choice Unit 4: Data Collections
// Assume: File f = new File("data.txt"); // File contains space-separated integers…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,821 of 3,140
Page 283 of 314