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 931–940 of 2,811
  1. 931
  2. 932
  3. 933
  4. 934
  5. 935
  6. 936
  7. 937
  8. 938
  9. 939
  10. 940

Question 931

Multiple choice Unit 2: Selection and Iteration
What is the output of this code segment? int a = 3, b = 7;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 932

Multiple choice Unit 2: Selection and Iteration
What is the value of result after the following executes? String result = "";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 933

Multiple choice Unit 2: Selection and Iteration
What is the value of sum after the following executes? int sum =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 934

Multiple choice Unit 2: Selection and Iteration
Which of the following boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 935

Multiple choice Unit 2: Selection and Iteration
Consider the following code: int count = 0; for (int i = 0; i < 4; i++) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 936

Multiple choice Unit 2: Selection and Iteration
What is the output of the following code? int n = 4; for (int i = 1; i <= n; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 937

Multiple choice Unit 2: Selection and Iteration
Which of the following code segments correctly counts the number of vowels in a String s? (Assume lowercase only.) // Segment I int count = 0; for (int i = 0; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 938

Multiple choice Unit 2: Selection and Iteration
Consider the following method that is supposed to check whether a String is a palindrome. public static boolean isPalindrome(String s) { int left = 0, right =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 939

Multiple choice Unit 2: Selection and Iteration
What does the following method return when called as mystery(6)? public static int mystery(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 940

Multiple choice Unit 2: Selection and Iteration
The following code is meant to find the GCD of two positive integers using Euclid's algorithm. Which correctly completes…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 931 of 2,811
Page 94 of 282