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 21–30 of 316
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30

Question 21

Multiple choice Boolean Expressions
What is the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 22

Multiple choice Boolean Expressions
Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 23

Multiple choice Boolean Expressions
Why do we use if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 24

Multiple choice Boolean Expressions
Which if statement…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 25

Multiple choice Boolean Expressions
What is the output of this program? int phLevel = 9; if(phLevel < 7) { System.out.println("It is acidic!"); }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 26

Multiple choice Boolean Expressions
What is the output of this program? int numTreeRings = 50; System.out.println("How old is the tree?"); if(numTreeRings < 20) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 27

Multiple choice Boolean Expressions
Consider the following code snippet if (x == y) { // Statement A } else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 28

Multiple choice Boolean Expressions
Consider the following code snippet if (x == y) { // Statement A } else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 29

Multiple choice Boolean Expressions
Choose the answer that will always produce the same output as the if-else statement below. Assume that grams is an int variable that has been declared and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 30

Multiple choice Boolean Expressions
Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 21 of 316
Page 3 of 32