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.

Subtopic: Boolean Expressions Clear filter

Questions 111–120 of 316
  1. 111
  2. 112
  3. 113
  4. 114
  5. 115
  6. 116
  7. 117
  8. 118
  9. 119
  10. 120

Question 111

Multiple choice Boolean Expressions
Suppose p and q are declared as boolean variables and have been initialized to unknown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 112

Multiple choice Boolean Expressions
Consider the following code segment: for (int i = 200; i > 0; i /= 3) { if (i % 2 == 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 113

Multiple choice Boolean Expressions
Suppose p and q are declared as boolean variables and have been initialized to unknown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 114

Multiple choice Boolean Expressions
Given int x = 7 and int y = 3, what is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 115

Multiple choice Boolean Expressions
Consider the following boolean expression: !(x > 5 && y < 10) ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 116

Multiple choice Boolean Expressions
Consider the following code segment: int x = 5; int y = 10; boolean result = (x > 7) && (y++ <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 117

Multiple choice Boolean Expressions
The following method is intended to return "Renaissance" for years from 1400 to 1600, inclusive, "Medieval" for years from 400 to 1399, inclusive, or "Other"…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 118

Multiple choice Boolean Expressions
What is printed by the following code? int x = 5; if (x > 3) { if (x > 7)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 119

Multiple choice Boolean Expressions
Which of the following boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 120

Multiple choice Boolean Expressions
What is the output of this code? int a = 2, b = 3, c = 4; if (a < b && b < c) a = b +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 111 of 316
Page 12 of 32