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,801–2,810 of 3,140
  1. 2801
  2. 2802
  3. 2803
  4. 2804
  5. 2805
  6. 2806
  7. 2807
  8. 2808
  9. 2809
  10. 2810

Question 2801

Multiple choice Unit 4: Data Collections
The following method is a correct implementation of the selection sort algorithm. The method sorts the elements of arr so that they are in order from least to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2802

Multiple choice Unit 4: Data Collections
Consider the following method. public static void mystery(int j, int k) { if (j > k) { mystery(j -…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2803

Free response Unit 4: Data Collections
The ItemInfo class is used to store information about an item at a store. A partial declaration of the ItemInfo class is shown. public class ItemInfo { /** *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2804

Free response Unit 4: Data Collections
The Appointment class is used to store information about a person's scheduled appointments. A partial declaration of the Appointment class is shown. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2805

Free response Unit 4: Data Collections
A tournament round pairs best-ranked competitors with worst-ranked competitors. Implement the Round constructor and buildMatches. Names are ordered from best to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2806

Free response Unit 4: Data Collections
This question involves reasoning about a number puzzle that is represented as a two-dimensional array of integers. Each element of the array initially contains…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2807

Multiple choice Unit 4: Data Collections
Consider the following code segment. What is printed when this code is executed? ArrayList<String> list = new ArrayList<>(); list.add("apple");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2808

Multiple choice Unit 4: Data Collections
info.txt contains exactly 2.5 Hello World. The file exists, opens successfully, and the enclosing method handles checked file-opening exceptions. What happens?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2809

Multiple choice Unit 4: Data Collections
Does this method compile? Assume the imports are present. public void readFile(String filename){ java.util.Scanner scan=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2810

Multiple choice Unit 4: Data Collections
data.txt contains one line: Hello-World-AP-CSA. The file opens successfully and checked exceptions are handled by the enclosing method. What is printed?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,801 of 3,140
Page 281 of 314