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 251–260 of 357
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

Multiple choice Boolean Expressions
The int variables amount and divisor satisfy 0 <= amount <= 30 and 0 <= divisor <= 10. The expression below is safe. Which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 252

Multiple choice Boolean Expressions
What happens when this code runs? int p = 5; int q = 2; boolean result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 253

Multiple choice Boolean Expressions
What is printed? int a = 10; int b = 4; boolean earlier = a / b == 2; a %= b; b -=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 254

Multiple choice Boolean Expressions
What is printed? int n = 13; int d = 5; double first = (double) (n / d); double second =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 255

Multiple choice Boolean Expressions
The variable n has type int. Which offered value makes the entire…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 256

Multiple choice Boolean Expressions
What is printed? double reading = -7.8; int whole = (int) reading; int half = (int) (reading / 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 257

Multiple choice Boolean Expressions
The int variables completed and total satisfy 0 <= completed <= total and 1 <= total <= 1000. A task is sufficiently…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 258

Multiple choice Boolean Expressions
What happens when this code runs? int numerator = 9; int divisor = 2 / 3; boolean valid = divisor >=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 259

Multiple choice Boolean Expressions
What is printed? int total = 6; int group = 2; total /= group; group -= total; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 260

Multiple choice Boolean Expressions
A request is valid only when used is from 0 through 10 inclusive. Within that range, it is allowed when space remains or…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 251 of 357
Page 26 of 36