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,011–2,020 of 2,811
  1. 2011
  2. 2012
  3. 2013
  4. 2014
  5. 2015
  6. 2016
  7. 2017
  8. 2018
  9. 2019
  10. 2020

Question 2011

Multiple choice Unit 4: Data Collections
The nonempty array contains a4. Return a new array of all elements after the last 4. Which replacement for /* missing */ makes the method meet its specification…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2012

Multiple choice Unit 4: Data Collections
An interior val is alone when both neighbors differ from val. Replace each such occurrence with the larger neighbor. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2013

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 2014

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 2015

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 2016

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 2017

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 2018

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 2019

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 2020

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 2,011 of 2,811
Page 202 of 282