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 21–30 of 143
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30

Question 21

Free response Arraylists
A train is composed of an engine and any number of train cars. The engine is rated to pull up to a maximum weight, based on its power. The weight of all the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 22

Free response 2D Arrays
The colors of the pixels on a TV or computer screen are made by combining different quantities of red, green, and blue light. Each of the three colors is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 23

Free response Arraylists
A printing factory maintains many printing machines that hold rolls of paper. public class Machine { private PaperRoll paper; public Machine(PaperRoll roll) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 24

Free response 2D Arrays
A hex grid is a type of two-dimensional (2-D) map used by many games to represent the area that tokens, ships, robots, or other types of game pieces can move…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 25

Free response 2D Arrays
This question involves a two-dimensional array of integers that represents a collection of randomly generated data. A partial declaration of the Data class is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 26

Free response Arraylists
Consider a system for processing names and addresses from a mailing list. A Recipients class will be used as part of this system. The lines in the mailing list…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 27

Free response 2D Arrays
A puzzle-solving competition is held in a large hall with a two-dimensional arrangement of contestants. Each rectangle below represents one contestant. A…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 28

Free response Arraylists
Consider a note keeper object that is designed to store and manipulate a list of short notes. Here are some typical notes: pick up drycleaning special dog chow…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 29

Free response 2D Arrays
Consider the problem of keeping track of the available seats in a theater. Theater seats can be represented with a two-dimensional array of integers, where a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 30

Free response Arraylists
A text-editing program uses a Sentence class that manipulates a single sentence. A sentence contains letters, blanks, and punctuation. The first character in a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 21 of 143
Page 3 of 15