Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Practice Questions

Work through AP Computer Science A practice questions on Selection and Iteration, 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 191–200 of 740
  1. 191
  2. 192
  3. 193
  4. 194
  5. 195
  6. 196
  7. 197
  8. 198
  9. 199
  10. 200

Question 191

Multiple choice 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 192

Multiple choice Boolean Expressions
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 193

Multiple choice Boolean Expressions
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 194

Multiple choice 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 195

Multiple choice Boolean Expressions
Consider the following incomplete method. public boolean validation(int x, int y) { /* missing code */ } The following table shows several examples of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 196

Multiple choice Boolean Expressions
Consider the following method. public String calculate(int num1, int num2) { if (num1 >= 0 && num2 >= 0) return "Numbers are valid"; return "Numbers are not…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 197

Multiple choice Boolean Expressions
Assume truth1 and truth2 are boolean variables that have been properly declared and initialized. Consider…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 198

Multiple choice Boolean Expressions
Assume that the variable declarations have been made. int a = 7, b = 15, c = -6; Which will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 199

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 200

Multiple choice Boolean Expressions
At a certain high school students receive letter grades based on the following scale. Numeric Score Letter Grade 93 or above A From 84 to 92 inclusive B From 75…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 191 of 740
Page 20 of 74