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.

Questions 431–440 of 1,222
  1. 431
  2. 432
  3. 433
  4. 434
  5. 435
  6. 436
  7. 437
  8. 438
  9. 439
  10. 440

Question 431

Free response Arraylists
A two-dimensional array of integers in which most elements are zero is called a sparse array. Because most elements have a value of zero, memory can be saved by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 432

Free response 2D Arrays
The LightBoard class models a two-dimensional display of lights, where each light is either on or off, as represented by a Boolean value. You will implement a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 433

Free response Arraylists
A student plans to analyze product reviews found on a Web site by looking for keywords in posted reviews. The ProductReview class, shown below, is used to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 434

Free response 2D Arrays
A theater contains rows of seats with the same number of seats in each row. Some rows contain tier 1 seats, and the remaining rows contain tier 2 seats. Tier 1…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 435

Multiple choice Arraylists
Assume list is an ArrayList<Integer> that has been correctly constructed and populated with the following items. [13, 7, 0, 5, 12, 6, 10] Consider the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 436

Multiple choice Arraylists
Consider the following code segment. ArrayList<String> supernatural = new ArrayList<String>(); supernatural.add("Vampire"); supernatural.add("Werewolf");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 437

Multiple choice 2D Arrays
Suppose that grid has been initialized as n-by-n 2-D array of integers.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 438

Multiple choice Recursion
Consider the following method. public int loopy(int n) { if (n % 7 == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 439

Multiple choice Arrays
Consider the following code segment. int [] array = {-3, 0, 2, 4, 5, 9, 13, 1, 5}; for (int n = 1; n < array.length - 1; n++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 440

Multiple choice Arrays
Consider the following code segment. int [] ray = new int [11]; for (int i = 0; i < ray.length; i++) { ray[i] = i * 2; } for (int m = 0; m < 5;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 431 of 1,222
Page 44 of 123