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 991–1,000 of 3,140
  1. 991
  2. 992
  3. 993
  4. 994
  5. 995
  6. 996
  7. 997
  8. 998
  9. 999
  10. 1000

Question 991

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int num = 0, score = 10; if (num != 0 && score / num >…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 992

Multiple choice Unit 2: Selection and Iteration
Refer to the following program segment. for (int n = 50; n > 0; n = n / 2)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 993

Multiple choice Unit 2: Selection and Iteration
Consider the following static method. public static int compute(int n) { for (int i = 1; i < 4; i++) n *= n; return n; } Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 994

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int num1 = value1, num2 = value2, num3 = value3; while (num1 > num2 || num1 > num3) { /* body of loop */ } You may…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 995

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int n = 25; n >= 0; n /= 2)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 996

Multiple choice Unit 2: Selection and Iteration
Consider the following loop, where n is some positive integer. for (int i = 0; i < n; i += 2) { if (/* test */) /* perform some…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 997

Multiple choice Unit 2: Selection and Iteration
Consider the code segment if (n == 1) k++; else if (n == 4) k += 4; Suppose that the given segment is rewritten in the form if (/* condition */) /* assignment…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 998

Multiple choice Unit 2: Selection and Iteration
Consider the following code snippet: public class Main { public static void main(String[] args) { boolean a = true; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 999

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1000

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: int a = 1, b = 2; for (int k = 1; k <= 2; k++) { int oldA = a; a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 991 of 3,140
Page 100 of 314