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 591–600 of 740
  1. 591
  2. 592
  3. 593
  4. 594
  5. 595
  6. 596
  7. 597
  8. 598
  9. 599
  10. 600

Question 591

Multiple choice Boolean Expressions
A programmer changes only the second if below to else if, attaching it to the first if. What happens when the changed code runs? int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 592

Multiple choice Boolean Expressions
What is printed? The code intentionally has no braces. boolean p = true;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 593

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 594

Multiple choice Boolean Expressions
The boolean variables p, q and r are initialized. Which condition is true exactly when C is printed?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 595

Multiple choice Boolean Expressions
The boolean variables p and q are initialized, and int result starts at 0. Which braced…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 596

Multiple choice Boolean Expressions
What is printed? int x = 5; int y = 2; if (x > 0) if (y > 3) System.out.print("A");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 597

Multiple choice Boolean Expressions
The boolean variables a, b and c are initialized. Which condition is true exactly when Z is printed?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 598

Multiple choice Boolean Expressions
Both versions use the same initialized boolean values p and q. Which condition describes exactly the inputs for which their complete outputs differ? //…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 599

Multiple choice Boolean Expressions
Here a is false; b and c are boolean and may have either value. Which labeled assignment bodies can execute for at…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 600

Multiple choice Boolean Expressions
The boolean variables outer and inner are initialized. The required behavior is: print A only when both are true; print B whenever outer is false; otherwise…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 591 of 740
Page 60 of 74