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 91–100 of 195
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

Multiple choice 2D Arrays
Consider a program that has a two-dimensional array mat of int values. The program has several methods that change mat by reflecting elements of mat across a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 92

Free response 2D Arrays
This question manipulates a two-dimensional array. In parts (a) and (b) you will write two methods of a Matrix class. In doing so, you will use the reverseArray…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 93

Multiple choice 2D Arrays
Consider the following code segment. int n = // some positive integer int [ ][ ] table = new int[n][n]; // input values into table int sum = 0; for (int row =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 94

Multiple choice 2D Arrays
Consider the following code segment. int m = // some positive integer int n = // some positive integer int [ ][ ] table = new int[m][n]; // input values into…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 95

Multiple choice 2D Arrays
Consider the following incomplete method. public static double findRowSum(double [][] mat, int n) { double sum = 0; // missing code return sum; } Method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 96

Multiple choice 2D Arrays
Consider the following definition and code segment. int [][] table = new int[5][5]; for (int row = 0; row < table.length-1; row++) for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 97

Free response 2D Arrays
Free-Response Practice: Modifying a 2D array Write a method that takes a 2D array as a parameter and returns a new 2D array. The even rows of the new array…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 98

Free response 2D Arrays
Free-Response Practice: Filling a 2D array Write a method that will fill in a 2D boolean array with a checkerboard pattern of alternating true and false. The…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Free response 2D Arrays
Find all the songs that contain the word "Love" in the title. One of the most popular themes in music lyrics is love. Suppose a compilation of thousands of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 100

Multiple choice 2D Arrays
Consider the following class definition: public class Matrix { private double[][] data; public Matrix(int rows, int cols) { // < missing statements > } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 91 of 195
Page 10 of 20