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 901–910 of 2,811
  1. 901
  2. 902
  3. 903
  4. 904
  5. 905
  6. 906
  7. 907
  8. 908
  9. 909
  10. 910

Question 901

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 902

Multiple choice Unit 2: Selection and Iteration
Consider the following code. int x = 0; if (x == 0) System.out.print("1"); else System.out.print("2");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 903

Multiple choice Unit 2: Selection and Iteration
Consider the following boolean expression. (X && !Y) || (!X && Y) Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 904

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. boolean a = true, b = false; if (/* missing code */) System.out.print("Nice job."); else System.out.print("Nicer job.");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 905

Multiple choice Unit 2: Selection and Iteration
Suppose p and q are declared as boolean variables and have been initialized to unknown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 906

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: for (int i = 200; i > 0; i /= 3) { if (i % 2 == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 907

Multiple choice Unit 2: Selection and Iteration
Suppose p and q are declared as boolean variables and have been initialized to unknown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 908

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int val1 = 2, val2 = 22, val3 = 78; while (val2 % val1 == 0…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 909

Multiple choice Unit 2: Selection and Iteration
What will be the output when the following code is evaluated? for (int k = 0; k < 3;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 910

Multiple choice Unit 2: Selection and Iteration
Consider the following code fragments. Assume someNum has been correctly defined and initialized as a positive integer. I. int i; for (i = 0; i < someNum; i++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 901 of 2,811
Page 91 of 282