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 91–100 of 357
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

Free response Boolean Expressions
Given 2 int values greater than 0, return whichever value is nearest to 21 without going over. Return 0 if they both go over.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 92

Free response Boolean Expressions
Given three ints, a b c, one of them is small, one is medium and one is large. Return true if the three values are evenly spaced, so the difference between…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 93

Free response Boolean Expressions
We want make a package of goal kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Return the number of small bars to use,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 94

Multiple choice Boolean Expressions
Vehicles are classified based on their total interior volume. The classify method is intended to return a vehicle classification String value based on total…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 95

Multiple choice Boolean Expressions
Which of the following best describes the value of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 96

Multiple choice Boolean Expressions
Consider the following code segment. int x = / * some integer value * /; int y = / * some integer value * /; if (x > y && x % 2 == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 97

Multiple choice Boolean Expressions
Consider the following code segment. Assume that x and y are properly declared and initialized integer variables. int z = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 98

Multiple choice Boolean Expressions
Consider the following code segment. Assume that value is a properly declared and initialized integer variable. if (value < 7) { value + = value;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Multiple choice Boolean Expressions
Assume that x and y are boolean variables and have been properly initialized. (x && y) ||…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 100

Multiple choice Boolean Expressions
Which of the following Java expressions evaluates to true if the int variable…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 91 of 357
Page 10 of 36