Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, 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.

Subtopic: Arrays Clear filter

Questions 241–250 of 341
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Free response Arrays
StudentRecord holds more than one integer score. Scores have improved if every successive score is at least the preceding score. Improved records average only…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 242

Free response Arrays
Customers have a name and positive unique ID and are ordered by name, then ID. Implement a comparison and a two-pass intersection of sorted customer arrays.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 243

Free response Arrays
A positive integer is a self-divisor when every decimal digit divides the original number. A0 digit disqualifies it. For example128 qualifies, while26 does not…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 244

Free response Arrays
Trail elevations are recorded at regularly spaced markers in the int array markers. Ignore slopes between the markers. public class Trail { private int[]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 245

Free response Arrays
Sound stores digital samples as integers. Implement two independent methods. public class Sound { private int[] samples; // nonnull public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 246

Free response Arrays
A multiplayer game called Token Pass has the following rules. Each player begins with a random number of tokens (at least 1, but no more than 10) that are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 247

Free response Arrays
Book objects are ordered alphabetically by title, then by publication year. Each input shelf is sorted and individually duplicate-free. A book with the same…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 248

Multiple choice Arrays
Two vertical lines at indices left and right enclose area(right−left)×min(height[left],height[right]). Return the greatest area; heights are nonnegative,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 249

Multiple choice Arrays
What is printed? String[] a={"A","B"}; String[] b=a; String[] c={a[0],a[1]} String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 250

Multiple choice Arrays
What is v[4] after this code? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 241 of 341
Page 25 of 35