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 951–960 of 3,140
  1. 951
  2. 952
  3. 953
  4. 954
  5. 955
  6. 956
  7. 957
  8. 958
  9. 959
  10. 960

Question 951

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment: while ((x > y) || y >= z) { System.out.print("*"); } In the code segment above,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 952

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 953

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int count = 1; int value = 31; while (value >= 10) { value = value -…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 954

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 955

Multiple choice Unit 2: Selection and Iteration
Which of the following code segments will print exactly eight "$" symbols? I. for (int i = 0; i < 8; i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 956

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int a = /* value supplied within program */ int b = /* value supplied within program */ if (/* missing condition */) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 957

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int n = 0 ; while ( n < 20) { System.out.print(n % 4 + " " ) ; if (…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 958

Multiple choice Unit 2: Selection and Iteration
Consider the following method. public int someMethod(int val) { for (int i = 2; i < 7; i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 959

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int num1 = 2; int num2 = 13; int result = 4; if ((num1 < 5) && (num2 < 5)) result = num1 - num2; else if ((num1 ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 960

Multiple choice Unit 2: Selection and Iteration
Assume that k, m, and n have been declared and correctly initialized with int values. Consider the following statement.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 951 of 3,140
Page 96 of 314