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 881–890 of 2,811
  1. 881
  2. 882
  3. 883
  4. 884
  5. 885
  6. 886
  7. 887
  8. 888
  9. 889
  10. 890

Question 881

Multiple choice Unit 2: Selection and Iteration
Which of the following code segments will produce the following output? 1 22 333 4444 Code Segments: I. for (int i = 1; i < 5; i++) { for (int j = i; j > 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 882

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int i = a random number such that 1 <= i <= n; for (int a = 2; a <= i; a++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 883

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 884

Multiple choice Unit 2: Selection and Iteration
What are the values of a and b after the for loop finishes? int a = 10; int b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 885

Multiple choice Unit 2: Selection and Iteration
Consider the following method: public static void sample(int num1, int num2) { int result = 99; if (num1 == num2) { result = 0; } else if (num1 > num2) { result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 886

Multiple choice Unit 2: Selection and Iteration
Given the following code segment: for (int j = 1; j <= 5; j++) { for (int k = 1; k <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 887

Multiple choice Unit 2: Selection and Iteration
Consider the following method: public void sample(int num1, int num2) { int result = 99; if (num1 == num2) { result = 0; } else if (num1 > num2) { result = 1; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 888

Multiple choice Unit 2: Selection and Iteration
Given the following code segment: int t = 13; while (t < 29) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 889

Multiple choice Unit 2: Selection and Iteration
Given the following code segment: int a = 5, b = 2, temp; for (int i = 1; i <= 4; i++) { temp…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 890

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: for(int i = 0; i < 3; i++) { for(int j = 1; j <= 7;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 881 of 2,811
Page 89 of 282