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,771–1,780 of 2,811
  1. 1771
  2. 1772
  3. 1773
  4. 1774
  5. 1775
  6. 1776
  7. 1777
  8. 1778
  9. 1779
  10. 1780

Question 1771

Multiple choice Unit 4: Data Collections
Consider the following method that is intended to modify its parameter nameList by replacing all occurrences of name with newValue. public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1772

Multiple choice Unit 4: Data Collections
Consider the following method. // precondition: x >= 0 public void mystery(int x) { if ((x / 10) != 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1773

Multiple choice Unit 4: Data Collections
The following incomplete method is intended to sort its array parameter arr in increasing order. // postcondition: arr is sorted in increasing order public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1774

Multiple choice Unit 4: Data Collections
Consider the following method. Method allEven is intended to return true if all elements in array arr are even numbers; otherwise, it should return false.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1775

Multiple choice Unit 4: Data Collections
Consider the following incomplete method. Method findNext is intended to return the index of the first occurrence of the value val beyond the position start in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1776

Multiple choice Unit 4: Data Collections
Consider the following declaration of the class NumSequence, which has a constructor that is intended to initialize the instance variable seq to an ArrayList of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1777

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public static String recur(int val) { String dig = "" + (val % 3); if (val / 3 > 0) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1778

Multiple choice Unit 4: Data Collections
Consider the following method. public String goAgain(String str, int index) { if (index >= str.length()) return str; return str +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1779

Multiple choice Unit 4: Data Collections
Given the following code which of the answers best describes the conditions needed for temp to be true when it is returned?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1780

Multiple choice Unit 4: Data Collections
Consider the following code segment. List<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.set(1, "c");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,771 of 2,811
Page 178 of 282