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,101–2,110 of 2,811
  1. 2101
  2. 2102
  3. 2103
  4. 2104
  5. 2105
  6. 2106
  7. 2107
  8. 2108
  9. 2109
  10. 2110

Question 2101

Multiple choice Unit 4: Data Collections
public int result(int n) { if (n == 1) return 2; else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2102

Multiple choice Unit 4: Data Collections
public int result(int n) { if (n == 1) return 2; else return 2 * result(n - 1); } If…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2103

Multiple choice Unit 4: Data Collections
Refer to method mystery. public int mystery(int n, int a, int d) { if (n == 1) return a;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2104

Multiple choice Unit 4: Data Collections
Refer to method f. public int f(int k, int n) { if (n == k) return k; else if (n > k)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2105

Multiple choice Unit 4: Data Collections
What does method recur do? / * x is an array of n integers. * n is a positive integer. * / public int recur(int[] x,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2106

Multiple choice Unit 4: Data Collections
Which best describes what the printString method below does? public void printString(String s)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2107

Multiple choice Unit 4: Data Collections
Refer to the method power. / * * Returns base raised to the expo power. * Precondition: * - base is a nonzero real number. * - expo is an integer. * / public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2108

Multiple choice Unit 4: Data Collections
Consider the following method. public void doSomething(int n) { if (n > 0) { doSomething(n - 1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2109

Multiple choice Unit 4: Data Collections
A user enters several positive integers at the keyboard and terminates the list with a sentinel (-999). A writeEven method reads those integers and outputs the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2110

Multiple choice Unit 4: Data Collections
What is returned by mystery(3)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,101 of 2,811
Page 211 of 282