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 921–930 of 2,811
  1. 921
  2. 922
  3. 923
  4. 924
  5. 925
  6. 926
  7. 927
  8. 928
  9. 929
  10. 930

Question 921

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = 5; int y = 10; boolean result = (x > 7) && (y++ <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 922

Multiple choice Unit 2: Selection and Iteration
The following method is intended to return "Renaissance" for years from 1400 to 1600, inclusive, "Medieval" for years from 400 to 1399, inclusive, or "Other"…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 923

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int j = 4; j > 0; j--) { for (/* missing code */) { System.out.print(k + " "); } System.out.println(); } This code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 924

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 925

Multiple choice Unit 2: Selection and Iteration
A programmer has mistakenly placed a semicolon at the end of the while statement in the following code fragment. What will be the result of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 926

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 927

Multiple choice Unit 2: Selection and Iteration
How many times is "Hello" printed by the following code? for (int i = 1; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 928

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. What is the final value of product? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 929

Multiple choice Unit 2: Selection and Iteration
A method is intended to return the largest digit in an…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 930

Multiple choice Unit 2: Selection and Iteration
What is printed by the following code? int x = 5; if (x > 3) { if (x > 7)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 921 of 2,811
Page 93 of 282