Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections FRQ

Work through AP Computer Science A free-response 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 1–10 of 143
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10

Question 1

Free response Arraylists
The factory keeps track of its printing machines in array machines, and it keeps track of its paper supply in two lists: newRolls to hold fresh rolls and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2

Free response Arrays
Customers are ordered alphabetically by name, then by positive integer ID when names match. Matching names and IDs identify equal customers. Complete both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 3

Free response Arrays
The PR2004 is a robot that automatically gathers toys and other items scattered in a tiled hallway. A tiled hallway has a wall at each end and consists of a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 4

Free response Arrays
This question involves reasoning about an array of integers with no duplicate values. An inversion is a pair of values in an array where a larger value appears…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 5

Free response 2D Arrays
A rectangular two-dimensional (2D) array named map represents an area where treasures are hidden. The element map[r][c] represents the object at row r and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 6

Free response Arrays
A statistician is studying sequences of numbers obtained by repeatedly tossing a six-sided number cube. On each side of the number cube is a single number in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 7

Free response Arrays
An electric car that runs on batteries must be periodically recharged for a certain number of hours. The battery technology in the car requires that the charge…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 8

Free response Arraylists
A game uses square tiles that have numbers on their sides. Each tile is labeled with a number on each of its four sides and may be rotated clockwise, as…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 9

Free response Arraylists
This question involves reasoning about pairs of words that are represented by the following WordPair class. public class WordPair { /** Constructs a WordPair…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 10

Free response 2D Arrays
This question involves reasoning about arrays of integers. You will write two static methods, both of which are in a class named ArrayTester. public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1 of 143
Page 1 of 15