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,171–2,180 of 3,140
  1. 2171
  2. 2172
  3. 2173
  4. 2174
  5. 2175
  6. 2176
  7. 2177
  8. 2178
  9. 2179
  10. 2180

Question 2171

Multiple choice Unit 4: Data Collections
Using inclusive bounds and floor midpoint, how many midpoint…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2172

Multiple choice Unit 4: Data Collections
Return the count of even integers, including 0. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2173

Multiple choice Unit 4: Data Collections
For a nonempty array whose maximum-minus-minimum fits in int, return that difference. 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 2174

Multiple choice Unit 4: Data Collections
Return the centered average: remove exactly one smallest and one largest occurrence, then use integer division. Length≥3; sum fits in int. Which replacement for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2175

Multiple choice Unit 4: Data Collections
Sum values, excluding every 13 and any value immediately after a13; empty input gives0. Sum fits in int. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2176

Multiple choice Unit 4: Data Collections
Sum the array except sections starting at a6 and ending at the next7 inclusive. Every 6 has a later7. Sum fits in int. Which replacement for /* missing */ makes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2177

Multiple choice Unit 4: Data Collections
Return true if a2 is adjacent to another2. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2178

Multiple choice Unit 4: Data Collections
Return true if there are no 1s and no 3s. Which replacement for /* missing */ makes the method meet its specification for all valid inputs?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2179

Multiple choice Unit 4: Data Collections
Return true if the sum of all 2s is exactly8. Which replacement for /* missing */ makes the method meet its specification for all valid inputs? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2180

Multiple choice Unit 4: Data Collections
Return true if the number of 1s exceeds the number of 4s. Which replacement for /* missing */ makes the method meet its specification for all valid inputs?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,171 of 3,140
Page 218 of 314