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 801–810 of 3,140
  1. 801
  2. 802
  3. 803
  4. 804
  5. 805
  6. 806
  7. 807
  8. 808
  9. 809
  10. 810

Question 801

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int p = 5; int q = 2; int sum = 0; while (p <=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 802

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 803

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 804

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 805

Multiple choice Unit 2: Selection and Iteration
What is the output from the following code segment? for (int j = 1; j…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 806

Multiple choice Unit 2: Selection and Iteration
What are the first and last values output by the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 807

Multiple choice Unit 2: Selection and Iteration
The Boolean expression (x==y && !(x==y)) || ( x!=y &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 808

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 809

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int x = 7; int y = 3; if ((x < 10) && (y < 0)) System.out.println("Value is: "…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 810

Multiple choice Unit 2: Selection and Iteration
Assume that a and b have been defined and initialized as int values. The expression !(!(a !=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 801 of 3,140
Page 81 of 314