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,381–2,390 of 3,140
  1. 2381
  2. 2382
  3. 2383
  4. 2384
  5. 2385
  6. 2386
  7. 2387
  8. 2388
  9. 2389
  10. 2390

Question 2381

Free response Unit 4: Data Collections
The colors of the pixels on a TV or computer screen are made by combining different quantities of red, green, and blue light. Each of the three colors is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2382

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<String> foods = new ArrayList<String>(); foods.add("Hummus"); foods.add("Soup"); foods.add("Sushi"); foods.set(1,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2383

Multiple choice Unit 4: Data Collections
Consider the following output. A A A A P P P P C C C C Which of the following code segments will produce this output? I. String[] letters = {"A", "P", "C",…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2384

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public int weird(int num) { if (num <= 0) return num; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2385

Multiple choice Unit 4: Data Collections
Consider the following method. public boolean verifyValues(int[] values) { for (int index = values.length - 1; index > 0; index--) { /* missing code */ return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2386

Multiple choice Unit 4: Data Collections
Consider the following code segment. int [] [] matrix = new int [3] [3]; int value = 0; for (int row = 0;row < matrix.length;row++) { for (int column = 0;column…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2387

Multiple choice Unit 4: Data Collections
Consider the following method. /** Precondition: numbers.size() > 0 */ public int totalValue(ArrayList<Integer> numbers) { int total = 0; for (Integer val :…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2388

Multiple choice Unit 4: Data Collections
Assume that planets has been correctly instantiated and initialized to contain the names of the planets. Which of the following code segments will reverse the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2389

Multiple choice Unit 4: Data Collections
Consider the following code segment. String exampleString = "computer"; ArrayList<String> words = new ArrayList<String>(); for (int k = 0; k <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2390

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public void wackyOutput (String wacky) { if (wacky.length() < 1) return; wacky =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,381 of 3,140
Page 239 of 314