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.

Questions 361–370 of 1,222
  1. 361
  2. 362
  3. 363
  4. 364
  5. 365
  6. 366
  7. 367
  8. 368
  9. 369
  10. 370

Question 361

Multiple choice 2D Arrays
Consider a class MatrixStuff that has a private instance variable. private int[][] mat; Refer to method alter below that occurs in the MatrixStuff class. (The…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 362

Multiple choice 2D Arrays
This question refers to the following method. public static boolean isThere(String[][] mat, int row, int col, String symbol) { boolean yes; int i, count = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 363

Multiple choice 2D Arrays
The method changeNegs below should replace every occurrence of a negative integer in its matrix parameter with 0. /** Replaces all negative values in mat with…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 364

Multiple choice 2D Arrays
A two-dimensional array rainfall that contains double values will be used to represent the daily rainfall for a given year. In this scheme, rainfall[month][day]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 365

Multiple choice 2D Arrays
This question is based on the Point class below. public class Point { /** The coordinates. */ private int x; private int y; public Point (int xValue, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 366

Multiple choice 2D Arrays
A Tic-Tac-Toe board contains X, O or a blank. Each row of its string representation starts and ends with a vertical bar, with no internal separators, followed…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 367

Multiple choice Recursion
Which of the following statements about recursion are true? I Every recursive algorithm can be written iteratively. II Tail recursion is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 368

Multiple choice Recursion
Which of the following, when used as the /* body */ of method sum, will enable that method to compute 1 + 2 + ... + n correctly for any \(n \gt 0\)? / * returns…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 369

Multiple choice Recursion
Refer to the method stringRecur. public void stringRecur(String s) { if (s.length() < 15)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 370

Multiple choice Recursion
Refer to method strRecur. public void strRecur(String s) { if (s.length() < 15) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 361 of 1,222
Page 37 of 123