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.

Subtopic: 2D Arrays Clear filter

Questions 41–50 of 195
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49
  10. 50

Question 41

Multiple choice 2D Arrays
A 2D double array is declared and initialized to track the terrain of a city park. Each value in the 2D array represents the height of a particular latitude and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 42

Multiple choice 2D Arrays
A 2D double array terrainMap is declared and initialized to track the terrain of a city park. Each value in the 2D array represents the height of a particular…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 43

Multiple choice 2D Arrays
A 2D double array terrainMap is declared and initialized to track the terrain of a city park. Each value in the 2D array represents the height of a particular…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 44

Multiple choice 2D Arrays
Which is the correct way to construct and assign a 2D…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 45

Multiple choice 2D Arrays
Consider the following code segment. int[][] points = {{11, 12, 13, 14, 15}, {21, 22, 23, 24, 25}, {31, 32, 33, 34, 35}, {41, 42, 43, 44, 45}}; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 46

Multiple choice 2D Arrays
Consider the following code segment. int[][] arr = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int sum = 0; for (int[] x :…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 47

Multiple choice 2D Arrays
Consider the following code segment. int[][] points = {{11, 12, 13, 14, 15}, {21, 22, 23, 24, 25}, {31, 32, 33, 34, 35}, {41, 42, 43, 44, 45}}; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 48

Multiple choice 2D Arrays
Consider the following code segment. int[][] arr = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int sum = 0; for (int[] x :…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 49

Multiple choice 2D Arrays
Consider the following code segment. int[][] rectangle = new int[4][5]; / * some statements not shown * / x = rectangle[0]; Assume that x has been previously…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 50

Multiple choice 2D Arrays
Consider the following method, which is intended to print the contents of a two-dimensional array of integers in row-major order. public static void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 41 of 195
Page 5 of 20