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 851–860 of 2,811
  1. 851
  2. 852
  3. 853
  4. 854
  5. 855
  6. 856
  7. 857
  8. 858
  9. 859
  10. 860

Question 851

Multiple choice Unit 2: Selection and Iteration
Which segment of code will correctly print the two Strings name1 and name2 in alphabetical order? if (name1 < name2) System.out.println(name1 + " " + name2); I.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 852

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int j = 0; j < 10; j++) { for (int k = 10; k > j; k--) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 853

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. boolean b1 = true; boolean b2 = true; int x = 7; while (b1 || b2) { if (x > 4) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 854

Multiple choice Unit 2: Selection and Iteration
Which of the following three code segments will produce the same output? I. int i = 1; while (i < 12) { System.out.print(i + " "); i *= 2; } II. for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 855

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. double count = 6.0; for (int num = 0; num < 5; num++) { if (count != 0 && num /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 856

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. double tabulate = 100.0; int repeat = 1; while (tabulate > 20) { tabulate = tabulate…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 857

Multiple choice Unit 2: Selection and Iteration
If a, b, and c are integers, which of the following conditions is sufficient…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 858

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int num = 0, score = 10; if (num != 0 && score / num >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 859

Multiple choice Unit 2: Selection and Iteration
Refer to the following program segment. for (int n = 50; n > 0; n = n / 2)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 860

Multiple choice Unit 2: Selection and Iteration
Consider the following static method. public static int compute(int n) { for (int i = 1; i < 4; i++) n *= n; return n; } Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 851 of 2,811
Page 86 of 282