Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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 2,281–2,290 of 3,140
  1. 2281
  2. 2282
  3. 2283
  4. 2284
  5. 2285
  6. 2286
  7. 2287
  8. 2288
  9. 2289
  10. 2290

Question 2281

Multiple choice Unit 4: Data Collections
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 2282

Multiple choice Unit 4: Data Collections
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 2283

Multiple choice Unit 4: Data Collections
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 2284

Multiple choice Unit 4: Data Collections
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 2285

Multiple choice Unit 4: Data Collections
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 2286

Multiple choice Unit 4: Data Collections
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 2287

Multiple choice Unit 4: Data Collections
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 2288

Multiple choice Unit 4: Data Collections
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 2289

Multiple choice Unit 4: Data Collections
public int result(int n) { if (n == 1) return 2; else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2290

Multiple choice Unit 4: Data Collections
public int result(int n) { if (n == 1) return 2; else return 2 * result(n - 1); } If…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,281 of 3,140
Page 229 of 314