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 941–950 of 2,811
  1. 941
  2. 942
  3. 943
  4. 944
  5. 945
  6. 946
  7. 947
  8. 948
  9. 949
  10. 950

Question 941

Multiple choice Unit 2: Selection and Iteration
What does the following method return for n = 7? public static boolean check(int n) { if (n < 2)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 942

Multiple choice Unit 2: Selection and Iteration
A method with parameter int n must return true if and only if n is a perfect square,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 943

Multiple choice Unit 2: Selection and Iteration
What is the output of this code? int a = 2, b = 3, c = 4; if (a < b && b < c) a = b +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 944

Multiple choice Unit 2: Selection and Iteration
What is the output of the following code? int x = 100; while (x > 1) { if (x %…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 945

Multiple choice Unit 2: Selection and Iteration
Consider the following method: public static String build(int n) { String s = ""; for (int i = 1; i <= n; i++) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 946

Multiple choice Unit 2: Selection and Iteration
What is printed when the following code executes? int n = 256; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 947

Multiple choice Unit 2: Selection and Iteration
What is the value of result after the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 948

Multiple choice Unit 2: Selection and Iteration
What is printed by the following code? int x = 1; while (x < 30)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 949

Multiple choice Unit 2: Selection and Iteration
What is the value of sum? int sum = 0; for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 950

Multiple choice Unit 2: Selection and Iteration
What is printed? String s = "mississippi"; int count = 0; for (int i = 0; i < s.length() - 1;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 941 of 2,811
Page 95 of 282