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,611–2,620 of 2,811
  1. 2611
  2. 2612
  3. 2613
  4. 2614
  5. 2615
  6. 2616
  7. 2617
  8. 2618
  9. 2619
  10. 2620

Question 2611

Multiple choice Unit 4: Data Collections
public static int countWordNull(String[][] arr) { int count = 0; for (int r = 0;r < arr.length;r++) { for (int c = 0;c < arr[r].length;c++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2612

Multiple choice Unit 4: Data Collections
public static int calculateValue(int n) { if (n <= 1) { return 1; } return n *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2613

Multiple choice Unit 4: Data Collections
public static int processValue(int n) { if (n == 0) { return 0; } return n +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2614

Multiple choice Unit 4: Data Collections
public static int evaluateNumber(int n) { if (n == 0) { return 1; } return 1 +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2615

Multiple choice Unit 4: Data Collections
public static int transformNumber(int n) { if (n == 0) { return 0; } if (n % 2 == 0) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2616

Multiple choice Unit 4: Data Collections
public static int analyzeValue(int n) { if (n == 1) { return 1; } return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2617

Multiple choice Unit 4: Data Collections
public static int recursiveProcess(int n) { if (n == 0) { return 0; } return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2618

Multiple choice Unit 4: Data Collections
Assume the file data.txt contains: 5 7 3 public static int readNumbers() throws Exception { Scanner file = new Scanner(new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2619

Multiple choice Unit 4: Data Collections
Assume the file data.txt contains: apple banana cat public static int countLines() throws Exception { Scanner file = new Scanner(new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2620

Multiple choice Unit 4: Data Collections
Assume the file data.txt contains: dog cat bird public static int totalLength() throws Exception { Scanner file = new Scanner(new File("data.txt"));…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,611 of 2,811
Page 262 of 282