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 71–80 of 143
  1. 71
  2. 72
  3. 73
  4. 74
  5. 75
  6. 76
  7. 77
  8. 78
  9. 79
  10. 80

Question 71

Free response Arraylists
GapInserter receives a strictly increasing ArrayList . Whenever two ORIGINAL consecutive values differ by exactly2, add the missing integer between them. Larger…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 72

Free response Arraylists
UniqueWordAnalyzer processes nonempty lowercase comments. Words are separated by single spaces; each comment contains at least one word. public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 73

Free response 2D Arrays
Highway is a rectangular nonempty int matrix: rows are lanes, columns are positions. A1 is a car and a0 an empty position. Cars move right; forward movement…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 74

Free response 2D Arrays
Seats in a movie theater are modeled by a two-dimensional array of boolean values: true represents an occupied seat and false represents a vacant seat. Row…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 75

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 76

Free response 2D Arrays
In chess, a queen can move vertically, horizontally, and diagonally on an 8-by-8 chessboard. The picture below shows all the positions on the board that a queen…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 77

Free response Arraylists
The Gizmo class represents gadgets that people purchase. Some Gizmo objects are electronic and others are not. A partial definition of the Gizmo class is shown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 78

Free response 2D Arrays
SmartParkingSimulator uses a rectangular boolean matrix: true means occupied, false available. Choose the first row from top to bottom with any vacancy; within…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 79

Free response Arraylists
Shipment stores destination, weight in kilograms and fragile status. ShipmentTracker maintains an ArrayList . Do not use Map or HashMap for grouping. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 80

Free response Arraylists
The ItemInfo class is used to store information about an item at a store. A partial declaration of the ItemInfo class is shown. public class ItemInfo { /** *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 71 of 143
Page 8 of 15