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 581–590 of 740
  1. 581
  2. 582
  3. 583
  4. 584
  5. 585
  6. 586
  7. 587
  8. 588
  9. 589
  10. 590

Question 581

Multiple choice Boolean Expressions
Both versions start with int x = 2 and int result = 0. Which statement is correct? Count only executions of the displayed result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 582

Multiple choice Boolean Expressions
Which offered initial value of the int n makes this code print AB? if (n % 2 == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 583

Multiple choice Boolean Expressions
Here p is false, q is false and r is true. How many of the three named conditions are evaluated, and how many assignment…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 584

Multiple choice Boolean Expressions
The int n is from 1 through 12 inclusive. Which list contains exactly the inputs for which two of the three bodies execute? if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 585

Multiple choice Boolean Expressions
What is printed? int x = 3; if (x < 4) { x += 3; System.out.print("A"); } if (x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 586

Multiple choice Boolean Expressions
Which labeled assignment bodies execute, in order? int x = 4; if (x > 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 587

Multiple choice Boolean Expressions
The boolean variables a and b are initialized. Which condition is true exactly when the final score…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 588

Multiple choice Boolean Expressions
What is printed? int n = 4; if (n < 6) { n += 4; } if (n > 7)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 589

Multiple choice Boolean Expressions
What is printed? int x = 7; int y = 3; if (x > y) { x = y + 1; } if (x ==…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 590

Multiple choice Boolean Expressions
The int n is initialized to one of the offered values. Which input makes all three labeled bodies…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 581 of 740
Page 59 of 74