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 41–50 of 692
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49
  10. 50

Question 41

Multiple choice Boolean Expressions
Assume that int variables x and y have been properly declared and…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 42

Multiple choice Iteration
Why do we use…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 43

Multiple choice Iteration
What will this while loop do?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 44

Multiple choice Iteration
Why does the following code produce an infinite loop? Choose the best answer. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 45

Multiple choice Iteration
Which statement could be added to the while loop below so that it doesn't run indefinitely?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 46

Multiple choice Iteration
What does the following code print? int x = -4;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 47

Multiple choice Iteration
How many times will the following code print out the value of x? public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 48

Multiple choice Iteration
Which for loop will…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 49

Multiple choice Iteration
Why do we use…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 50

Multiple choice Iteration
What does the following code print? for (int i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 41 of 692
Page 5 of 70