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,511–2,520 of 3,140
  1. 2511
  2. 2512
  3. 2513
  4. 2514
  5. 2515
  6. 2516
  7. 2517
  8. 2518
  9. 2519
  10. 2520

Question 2511

Multiple choice Unit 4: Data Collections
What does enigma(9) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2512

Multiple choice Unit 4: Data Collections
What does printStars(15) print? public void printStars(int n) { if(n==1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2513

Multiple choice Unit 4: Data Collections
What does weird("Hello") return? public String weird(String s) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2514

Multiple choice Unit 4: Data Collections
Array arr2 has been defined and initialized as follows. int[] arr2 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; If the array is being searched for the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2515

Multiple choice Unit 4: Data Collections
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2516

Multiple choice Unit 4: Data Collections
public int factors(int number) { return factors(number, number - 1, 0); } public int factors(int number, int check, int count) { if (number % check == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2517

Multiple choice Unit 4: Data Collections
What does function(24,3) return?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2518

Multiple choice Unit 4: Data Collections
Consider this recursive problem. In elementary school, we learned that if you add up the digits of a number and get a sum of 9, then that number is divisible by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2519

Multiple choice Unit 4: Data Collections
Which algorithm is implemented? Assume array is sorted ascending. public static int mystery(int[] array,int a) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2520

Multiple choice Unit 4: Data Collections
public void printSomething(String s) { int n = s.length(); if(n >= 1) { String s1 = s.substring(1,n); printSomething(s1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,511 of 3,140
Page 252 of 314