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,561–2,570 of 3,140
  1. 2561
  2. 2562
  3. 2563
  4. 2564
  5. 2565
  6. 2566
  7. 2567
  8. 2568
  9. 2569
  10. 2570

Question 2561

Multiple choice Unit 4: Data Collections
Consider the following method: private int product(int n) { if (n <= 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2562

Multiple choice Unit 4: Data Collections
Consider the following method: private int product(int n) { if (n <= 1) return 1; else return n * product(n - 2); }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2563

Multiple choice Unit 4: Data Collections
Consider the following method: /** * Rearranges the elements in words according to the values stored in an integer array indices, * so that the element of words…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2564

Multiple choice Unit 4: Data Collections
Given two arrays of double values sorted in ascending order, one with 100 elements and the other with 10 elements, how many…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2565

Multiple choice Unit 4: Data Collections
Consider the following code segment, intended to find the position of an integer targetValue in int[] a.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2566

Multiple choice Unit 4: Data Collections
Consider the following method, intended to use Binary Search to find the location of target within ArrayList<String> a. public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2567

Multiple choice Unit 4: Data Collections
Consider the following two implementations of the method getValue(double[] c, int n, double x) that computes and returns the value of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2568

Multiple choice Unit 4: Data Collections
What is printed as a result of executing the following code segment? ArrayList<String> digits = new ArrayList<String>(); for (int k = 0; k <= 9; k++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2569

Multiple choice Unit 4: Data Collections
A class Turtle has a void method forward(int d) that moves the turtle forward by d units. A class TurtleRace has a list of Turtle objects: private…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2570

Multiple choice Unit 4: Data Collections
If the classes House and HouseForSale compile with no errors,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,561 of 3,140
Page 257 of 314