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 231–240 of 316
  1. 231
  2. 232
  3. 233
  4. 234
  5. 235
  6. 236
  7. 237
  8. 238
  9. 239
  10. 240

Question 231

Multiple choice Boolean Expressions
The int variable score and the boolean variable extra are initialized. A programmer replaces the original condition with the proposed condition, keeping both…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 232

Multiple choice Boolean Expressions
What happens when this code runs? int denominator = 0; if (denominator == 0) { denominator = 3; } else { denominator +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 233

Multiple choice Boolean Expressions
What is printed? int points = 7; int credits = 2; if (credits…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 234

Multiple choice Boolean Expressions
What is printed? int value = 6; if (value < 10) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 235

Multiple choice Boolean Expressions
What is printed? int left = 4; int right = 9; boolean copyRight = false; if (copyRight) { left =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 236

Multiple choice Boolean Expressions
The boolean variable enabled is initialized. Which single statement can replace the entire code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 237

Multiple choice Boolean Expressions
What is printed? int fee = 8; boolean member = false; if (member) { fee =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 238

Multiple choice Boolean Expressions
An int variable n initially has a value from 0 through 8 inclusive. Which list contains all initial values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 239

Multiple choice Boolean Expressions
The variable x is an int. Which offered initial value of x is unchanged…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 240

Multiple choice Boolean Expressions
What is printed? int queued = 12; int batch; if (queued < 5) { batch = 1; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 231 of 316
Page 24 of 32