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.

Subtopic: Boolean Expressions Clear filter

Questions 31–40 of 357
  1. 31
  2. 32
  3. 33
  4. 34
  5. 35
  6. 36
  7. 37
  8. 38
  9. 39
  10. 40

Question 31

Multiple choice Boolean Expressions
What is the output of the following code snippet? double ticketPrice = 12.75; if(ticketPrice > 15) { System.out.println("Too expensive!"); } else…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 32

Multiple choice Boolean Expressions
The following code snippet should print the letter grade associated with the integer value in grade. However, the if - else if statements are in the wrong…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 33

Multiple choice Boolean Expressions
Which of the below…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 34

Multiple choice Boolean Expressions
What does this Java…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 35

Multiple choice Boolean Expressions
In the following line of code: boolean shortCircuit = true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 36

Multiple choice Boolean Expressions
What value of x would make this boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 37

Multiple choice Boolean Expressions
Which of the following logical statements is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 38

Multiple choice Boolean Expressions
Which of the following logical statements is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 39

Multiple choice Boolean Expressions
What boolean value is held in the following boolean variable if hasBike is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 40

Multiple choice Boolean Expressions
What boolean value is held in the following boolean variable if hasHeadlight is true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 31 of 357
Page 4 of 36