Verityprep
Question Bank · Unit 2

AP® Computer Science A Selection and Iteration Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 161–170 of 692
  1. 161
  2. 162
  3. 163
  4. 164
  5. 165
  6. 166
  7. 167
  8. 168
  9. 169
  10. 170

Question 161

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 162

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 163

Multiple choice Iteration
Consider the following output. 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 164

Multiple choice Boolean Expressions
Consider the following code segment. int num1 = 9; int num2 = 5; if (num1 > num2) { System.out.print((num1 + num2) %…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 165

Multiple choice Boolean Expressions
Consider the following code segment. int value = initValue; if (value > 10) if (value > 15) value = 0; else value =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 166

Multiple choice Boolean Expressions
Assume that a, b, and c have been declared and initialized with int values. The expression !(a > b || b…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 167

Multiple choice Boolean Expressions
A high school class places students in a course based on their average from a previous course. Students that have an average 92 or above are placed in an honors…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 168

Multiple choice Boolean Expressions
Assume that x, y, and z have been declared as follows: boolean x = true; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 169

Multiple choice Boolean Expressions
Consider the following code segment. int amount = initValue; if (amount…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 170

Multiple choice Boolean Expressions
Which segment of code will correctly print the two Strings name1 and name2 in alphabetical order? if (name1 < name2) System.out.println(name1 + " " + name2); I.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 692
Page 17 of 70