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.

Subtopic: 2D Arrays Clear filter

Questions 21–30 of 50
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30

Question 21

Free response 2D Arrays
A grayscale image is represented by a 2-dimensional rectangular array of pixels (picture elements). A pixel is an integer value that represents a shade of gray.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 22

Free response 2D Arrays
A telescope scans a rectangular area of the night sky and collects the data into a 1-dimensional array. Each data value scanned is a number representing the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 23

Free response 2D Arrays
This question involves reasoning about a two-dimensional (2D) array of integers. You will write two static methods, both of which are in a single enclosing…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 24

Free response 2D Arrays
This question involves pieces of candy in a box. The Candy class represents a single piece of candy. public class Candy { / * * Returns a String representing…

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 manipulation of one-dimensional and two-dimensional arrays. In part (a), you will write a method to shift the elements of a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 26

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 27

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 28

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 29

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 30

Free response 2D Arrays
The Appointment class is used to store information about a person's scheduled appointments. A partial declaration of the Appointment class is shown. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 21 of 50
Page 3 of 5