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.

Questions 271–280 of 692
  1. 271
  2. 272
  3. 273
  4. 274
  5. 275
  6. 276
  7. 277
  8. 278
  9. 279
  10. 280

Question 271

Multiple choice Boolean Expressions
Which of the following boolean expressions is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 272

Multiple choice Boolean Expressions
What is printed? int x = 15, y = 20, z = 10; String result = ""; if (x > z && y > x) { if (y - x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 273

Multiple choice Iteration
This method computes the digit sum of a positive integer. What does it print when n = 156?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 274

Multiple choice Iteration
What is printed? int total = 0; for (int i = 1; i <= 50; i++) { if (i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 275

Multiple choice Iteration
What is printed? int count = 0; for (int i = 1; i <= 4; i++) { for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 276

Multiple choice Boolean Expressions
What is the result of executing the following code? int x = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 277

Multiple choice Iteration
What is printed? String s = "COMPUTER"; String result = ""; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 278

Multiple choice Iteration
Consider the following method. public static int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 279

Multiple choice Boolean Expressions
What is printed? int a = 5, b = 12; boolean p = !(a > 3 && b < 10); boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 280

Multiple choice Iteration
What is printed? int count = 0; for (int i = 1; i <= 50; i++) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 271 of 692
Page 28 of 70