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 961–970 of 3,140
  1. 961
  2. 962
  3. 963
  4. 964
  5. 965
  6. 966
  7. 967
  8. 968
  9. 969
  10. 970

Question 961

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int h = 2; h <= 6; h += 2) { for (int k = 30; k > 0; k -= 10) { System.out.print(h + k + " "); } } Consider these…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 962

Multiple choice Unit 2: Selection and Iteration
Assume that a, b, and c have been declared and correctly initialized with int values. Consider the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 963

Multiple choice Unit 2: Selection and Iteration
Consider the following method. public int pathways(int n) { int ans; if (n < -5) ans = 1; else if (n < 0) ans = 2; else if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 964

Multiple choice Unit 2: Selection and Iteration
A resort wants to recommend activities for its guests, based on the temperature (degrees F) as follows: 76° and above go swimming 61°–75° go hiking 46°–60° go…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 965

Multiple choice Unit 2: Selection and Iteration
A resort wants to recommend activities for its guests, based on the temperature (degrees F) as follows: 76° and above go swimming 61°–75° go hiking 46°–60° go…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 966

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int h = 5; h >= 0; h = h - 2) { for (int k = 0; k < 3; k++) { if ((h…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 967

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int number = Integer.MAX_VALUE; while (number > 0) { number = number / 2; } for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 968

Multiple choice Unit 2: Selection and Iteration
Consider the code segment. if (value == 1) count += 1; else if (value == 2) count…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 969

Multiple choice Unit 2: Selection and Iteration
A bank will approve a loan for any customer who fulfills one or more of the following requirements: Has a credit score ≥ 640 Has a cosigner for the loan Has a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 970

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int value = 33; boolean calculate = true; while (value > 5 || calculate) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 961 of 3,140
Page 97 of 314