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,201–2,210 of 3,140
  1. 2201
  2. 2202
  3. 2203
  4. 2204
  5. 2205
  6. 2206
  7. 2207
  8. 2208
  9. 2209
  10. 2210

Question 2201

Multiple choice Unit 4: Data Collections
Return the same multiset of values with all zeros before all nonzeros; nonzero order is unrestricted. Which replacement for /* missing */ makes the method meet…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2202

Multiple choice Unit 4: Data Collections
Remove 10s while preserving all other values’ order, filling the unused tail with zeros. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2203

Multiple choice Unit 4: Data Collections
Assume nonnegative values. Replace each zero with the largest odd value to its right, or leave it0 if none exists. Which replacement for /* missing */ makes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2204

Multiple choice Unit 4: Data Collections
Return the same values with evens before odds; order within each group is unrestricted. Which replacement for /* missing */ makes the method meet its…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2205

Multiple choice Unit 4: Data Collections
For 0≤start≤end, return String values for the range[start, end), using Fizz for multiples of 3, Buzz for 5 and FizzBuzz for both. Which replacement for /*…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2206

Multiple choice Unit 4: Data Collections
The segment should count strings containing str as a substring. Which change is needed? String[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2207

Multiple choice Unit 4: Data Collections
For a nonempty int array, which segments replace every element with its square? I int k=0; while(k<nums.length) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2208

Multiple choice Unit 4: Data Collections
What does numbers contain afterward? ArrayList numbers=new ArrayList () numbers.add("one");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2209

Multiple choice Unit 4: Data Collections
Starting from [2,4,5,6,8], which replacement safely…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2210

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] points = {{11, 12, 13, 14, 15}, {21, 22, 23, 24, 25}, {31, 32, 33, 34, 35}, {41, 42, 43, 44, 45}}; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,201 of 3,140
Page 221 of 314