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,211–2,220 of 2,811
  1. 2211
  2. 2212
  3. 2213
  4. 2214
  5. 2215
  6. 2216
  7. 2217
  8. 2218
  9. 2219
  10. 2220

Question 2211

Multiple choice Unit 4: Data Collections
Consider an array arr of 64 distinct int values, which are sorted in increasing order. The first element of the array, arr[0], equals 5, and the last element,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2212

Multiple choice Unit 4: Data Collections
Consider the following program segment. /** Precondition: a[0]..a[n-1] is an initialized array of integers, * and 0 < n <= a.length. */ int c = 0; for (int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2213

Multiple choice Unit 4: Data Collections
Consider the following instance variable and methods in the same class. private int[][] matrix; /** Precondition: array.length > 0. * @return the largest…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2214

Multiple choice Unit 4: Data Collections
This question refers to the findCheapest method below, which occurs in a class that has an array of AutoPart as one of its private data fields. private…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2215

Multiple choice Unit 4: Data Collections
Consider an array arr and a list list that is an ArrayList<String>. Both arr and list are initialized with string values. Which of the following code segments…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2216

Multiple choice Unit 4: Data Collections
Consider the following mergeSort method and the private instance variable a both in the same Sorter class. private int[] a; /** Sorts a[first] to a[last] in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2217

Multiple choice Unit 4: Data Collections
A large hospital maintains a list of patients' records in no particular order. To find the record of a given patient,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2218

Multiple choice Unit 4: Data Collections
Consider method1 and method2 below, which are identical except for the second last line of code. Each method returns a new matrix based on the input matrix mat.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2219

Multiple choice Unit 4: Data Collections
Consider an ArrayList cards of Card objects that needs to be shuffled. The following algorithm is used for shuffling. Create a temporary ArrayList<Card> Do the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2220

Multiple choice Unit 4: Data Collections
Consider the following instance variables and method assignValues in the same class. private int numRows; private int numCols; private int[][] mat; /** arr has…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,211 of 2,811
Page 222 of 282