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,571–2,580 of 3,140
  1. 2571
  2. 2572
  3. 2573
  4. 2574
  5. 2575
  6. 2576
  7. 2577
  8. 2578
  9. 2579
  10. 2580

Question 2571

Multiple choice Unit 4: Data Collections
Which of the following code segments correctly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2572

Free response Unit 4: Data Collections
All emails received by the Office of Complaints in Appaloosa County are assigned a priority rank from 0 to 9 and answered in order of priority; emails of higher…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2573

Free response Unit 4: Data Collections
In a traffic modeling application, a segment of a highway is represented as a two-dimensional array of integers, in which each row represents one lane and each…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2574

Multiple choice Unit 4: Data Collections
Consider the following method intended to remove all elements with a value less than zero from an ArrayList<Integer>: public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2575

Multiple choice Unit 4: Data Collections
Consider the following code segment: int[] arr = {1, 2, 3, 4, 5, 6, 7, 8}; for (int k = 1; k <= 6; k += 2) { arr[7] = arr[k]; arr[k]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2576

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static void smile(int n) { if (n == 0) { return; } for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2577

Multiple choice Unit 4: Data Collections
Consider the following recursive method: public static void smile(int n) { if (n == 0) { return; } for (int k = 1; k <= n; k++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2578

Multiple choice Unit 4: Data Collections
Consider the following incomplete method, which shuffles a list of Card objects so that any card can end up at any index in the list deck, with equal…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2579

Multiple choice Unit 4: Data Collections
The method addStars is intended to append "*" at the end of each string in the ArrayList<String> words. Which of the following implementations of addStars will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2580

Multiple choice Unit 4: Data Collections
Consider the following method: public boolean examine(String[] letters) { int count = 0; for (String letter1 : letters) { for (String letter2 : letters) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,571 of 3,140
Page 258 of 314