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 1,781–1,790 of 2,811
  1. 1781
  2. 1782
  3. 1783
  4. 1784
  5. 1785
  6. 1786
  7. 1787
  8. 1788
  9. 1789
  10. 1790

Question 1781

Multiple choice Unit 4: Data Collections
The following incomplete method is intended to sort the array a in ascending order. public void sort() { int maxCompare = a.length - 1; int lIndex = 0; int temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1782

Multiple choice Unit 4: Data Collections
Given the following method and what would the result be when m is executed? public void m(int[][]p) { int height = p.length; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1783

Multiple choice Unit 4: Data Collections
What is the output from mystery(4321) when mystery is defined as follows: //precondition: x >=0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1784

Multiple choice Unit 4: Data Collections
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1785

Multiple choice Unit 4: Data Collections
Consider the following code segment: public static boolean check(String s) { return s.length() >= 2 &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1786

Multiple choice Unit 4: Data Collections
A two-dimensional array is used to represent a matrix. The declaration is below: private int[][] matrix = new int[2][3]; public static void changeMatrix(int[][]…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1787

Multiple choice Unit 4: Data Collections
What is printed when the following main method is executed? public class Searcher { private int[] arr = {1,3,5,8,9}; public int mystery(int low, int high, int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1788

Multiple choice Unit 4: Data Collections
Consider the following method. What value is returned from a call of mystery(5)?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1789

Multiple choice Unit 4: Data Collections
Which of the following correctly shows the iterations of an ascending (from…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1790

Multiple choice Unit 4: Data Collections
Given the following code: public static int mystery(String str) { if (str.length() == 0) return 1; else { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,781 of 2,811
Page 179 of 282