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,841–2,850 of 3,140
  1. 2841
  2. 2842
  3. 2843
  4. 2844
  5. 2845
  6. 2846
  7. 2847
  8. 2848
  9. 2849
  10. 2850

Question 2841

Multiple choice Unit 4: Data Collections
A method receives a 2D array int[][] m where all rows have…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2842

Multiple choice Unit 4: Data Collections
The following method is supposed to shift all elements of an array one position to the left, with the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2843

Free response Unit 4: Data Collections
A sensor produces a stream of numeric readings. Consider the following incomplete class: public class SensorLog { private ArrayList<Double> readings; public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2844

Free response Unit 4: Data Collections
A board game uses a 2D integer array where each cell holds a point value. Consider: public class GameBoard { private int[][] board; // rows x cols public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2845

Multiple choice Unit 4: Data Collections
What does list contain after the following loop? ArrayList<Integer> list = new ArrayList<Integer>(); list.add(3); list.add(1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2846

Multiple choice Unit 4: Data Collections
What is printed? int[][] m = {{2,7,6}, {9,5,1}, {4,3,8}}; int sum = 0; for (int i = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2847

Multiple choice Unit 4: Data Collections
What does arr contain after the following code? int[] arr = {5, 2, 8, 1, 9, 3}; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2848

Multiple choice Unit 4: Data Collections
What is printed? ArrayList<String> words = new ArrayList<String>(); words.add("cat"); words.add("car"); words.add("dog"); words.add("care"); words.add("card");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2849

Multiple choice Unit 4: Data Collections
The following method performs binary search and returns the number of comparisons made. What does bSearch(arr, 23) return? public static int bSearch(int[] arr,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2850

Multiple choice Unit 4: Data Collections
Selection sort finds the minimum element and swaps it to the front. After exactly 2 complete passes of selection sort on the following array, what is the array?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,841 of 3,140
Page 285 of 314