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 51–60 of 357
  1. 51
  2. 52
  3. 53
  4. 54
  5. 55
  6. 56
  7. 57
  8. 58
  9. 59
  10. 60

Question 51

Multiple choice Boolean Expressions
In order to ride the zip line, you need to be at least 12 years old and weigh at least 75 pounds, but no more than 300 pounds. Which of the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 52

Multiple choice Boolean Expressions
Given the following: if (x > y) { y *= 2; } else if (y > x) { x *= 2; } if (x > y) { y *= 2; } if (y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 53

Multiple choice Boolean Expressions
Assuming weekday and holiday are properly initialized booleans, which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 54

Multiple choice Boolean Expressions
What values for x and y will cause the program to execute the /* missing code */? if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 55

Multiple choice Boolean Expressions
Christine will go to the beach if it's not raining and if it's between 75°F and 95°F.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 56

Free response Boolean Expressions
You and your date are trying to get a table at a restaurant. The parameter "you" is the stylishness of your clothes, in the range 0..10, and "date" is the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 57

Free response Boolean Expressions
The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is between 60 and 90 (inclusive). Unless it is summer,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 58

Free response Boolean Expressions
You are driving a little too fast, and a police officer stops you. Write code to compute the result, encoded as an int value: 0=no ticket, 1=small ticket, 2=big…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 59

Free response Boolean Expressions
Given 2 ints, a and b, return their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just return 20.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 60

Free response Boolean Expressions
Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a boolean indicating if we are on vacation, return a string of the form "7:00" indicating…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 51 of 357
Page 6 of 36