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.

Questions 311–320 of 740
  1. 311
  2. 312
  3. 313
  4. 314
  5. 315
  6. 316
  7. 317
  8. 318
  9. 319
  10. 320

Question 311

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 312

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 313

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 314

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 315

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 316

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 317

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 318

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 319

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 320

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 311 of 740
Page 32 of 74