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,501–2,510 of 3,140
  1. 2501
  2. 2502
  3. 2503
  4. 2504
  5. 2505
  6. 2506
  7. 2507
  8. 2508
  9. 2509
  10. 2510

Question 2501

Multiple choice Unit 4: Data Collections
Count empty lockers. All Locker references are nonnull, and isInUse reports whether a locker is occupied. Which replacement for /* missing */ makes the method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2502

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

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

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

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

Free response Unit 4: Data Collections
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 2507

Free response Unit 4: Data Collections
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 2508

Free response Unit 4: Data Collections
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 2509

Multiple choice Unit 4: Data Collections
What does puzzle(10) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2510

Multiple choice Unit 4: Data Collections
What happens when mystery(11) is called using Java int arithmetic?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,501 of 3,140
Page 251 of 314