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 1,091–1,100 of 2,811
  1. 1091
  2. 1092
  3. 1093
  4. 1094
  5. 1095
  6. 1096
  7. 1097
  8. 1098
  9. 1099
  10. 1100

Question 1091

Multiple choice Unit 2: Selection and Iteration
Consider the following declarations. int x = 0; int y = 5; boolean b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1092

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1093

Multiple choice Unit 2: Selection and Iteration
Which of the following is true exactly when n is outside the range 5 through 12, inclusive?
Pick an answer, then check it. The solution opens in a window.

Question 1094

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int sum = 0; for (int k = 2; k <= 9; k = k + 2) { if (k…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1095

Multiple choice Unit 2: Selection and Iteration
Suppose a, b, and c are int variables. Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1096

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int n = 18; int total = 0; while (n > 0) { total…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1097

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int result = 1; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1098

Multiple choice Unit 2: Selection and Iteration
Consider the following method.
public static int process(int n)
{
    int count = 0;

    while (n >= 10)
    {
        if (n % 2 == 0)
            n = n / 2;
        else
            n = n - 1;
        count++;
    }

    return count;
}
What value is returned by process(19) ?
Pick an answer, then check it. The solution opens in a window.

Question 1099

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int x = 3; int y = 8; if (x > 4 && y++ > 7) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1100

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int total = 0; for (int i = 1; i <= 5; i++) { if (i % 2 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,091 of 2,811
Page 110 of 282