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 101–110 of 740
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Boolean Expressions
Given a, b, and c are properly initialized boolean values, what values…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Boolean Expressions
In order to ride the zip line, you need to be at least 12 years old and weigh at least 75 pounds, but no more than 300 pounds. Which of the following code…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Boolean Expressions
Given the following: if (x > y) { y *= 2; } else if (y > x) { x *= 2; } if (x > y) { y *= 2; } if (y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Boolean Expressions
Assuming weekday and holiday are properly initialized booleans, which…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Boolean Expressions
What values for x and y will cause the program to execute the /* missing code */? if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Boolean Expressions
Christine will go to the beach if it's not raining and if it's between 75°F and 95°F.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Iteration
Consider the following output. 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Iteration
How many times will the loop execute? int i = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Free response Boolean Expressions
You and your date are trying to get a table at a restaurant. The parameter "you" is the stylishness of your clothes, in the range 0..10, and "date" is the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Free response Boolean Expressions
The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is between 60 and 90 (inclusive). Unless it is summer,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 740
Page 11 of 74