Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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,291–2,300 of 2,811
  1. 2291
  2. 2292
  3. 2293
  4. 2294
  5. 2295
  6. 2296
  7. 2297
  8. 2298
  9. 2299
  10. 2300

Question 2291

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 2292

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 2293

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 2294

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 2295

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 2296

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 2297

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 2298

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 2299

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 2300

Multiple choice Unit 4: Data Collections
Consider the following code segment: int[] a = {0, 1}; int[] b = a; a[0] = 1; b[0] = 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,291 of 2,811
Page 230 of 282