Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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,001–1,010 of 3,140
  1. 1001
  2. 1002
  3. 1003
  4. 1004
  5. 1005
  6. 1006
  7. 1007
  8. 1008
  9. 1009
  10. 1010

Question 1001

Multiple choice Unit 2: Selection and Iteration
Assume that the int variables a and b have been properly declared and initialized. For which of the following pairs of values of a and b is the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1002

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment, which is supposed to calculate and print the sum of the numbers from 1 to 20: int count = 0,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1003

Multiple choice Unit 2: Selection and Iteration
Assume that the boolean variables x, y, and z have been properly declared and initialized. Given that x is true, y is true, and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1004

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int n = 1, d = 1, s = 1; while (n <= 5) { System.out.print(s +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1005

Multiple choice Unit 2: Selection and Iteration
Assume that the boolean variables a, b, and c have been properly declared and initialized. Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1006

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int num = 5; while (num >= 0) { num -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1007

Multiple choice Unit 2: Selection and Iteration
I. int i = 1; while (i II. for (int i = 0; i < 5; i++) { System.out.print(2*i + 1); } III. for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1008

Multiple choice Unit 2: Selection and Iteration
Consider the following expressions, where x and y are boolean variables with different values: I. (x || y) && (!x ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1009

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int x = <integer value>, y = <another integer value>; while (x > y && x % y != 0) { x -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1010

Multiple choice Unit 2: Selection and Iteration
What is printed when the following code segment is executed? int sum = 0, d = -1; for (int count =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,001 of 3,140
Page 101 of 314