Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice questions unit by unit, 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 881–890 of 3,140
  1. 881
  2. 882
  3. 883
  4. 884
  5. 885
  6. 886
  7. 887
  8. 888
  9. 889
  10. 890

Question 881

Multiple choice Unit 2: Selection and Iteration
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 882

Multiple choice Unit 2: Selection and Iteration
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 883

Multiple choice Unit 2: Selection and 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 884

Multiple choice Unit 2: Selection and 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 885

Free response Unit 2: Selection and Iteration
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 886

Free response Unit 2: Selection and Iteration
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 887

Free response Unit 2: Selection and Iteration
You are driving a little too fast, and a police officer stops you. Write code to compute the result, encoded as an int value: 0=no ticket, 1=small ticket, 2=big…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 888

Free response Unit 2: Selection and Iteration
Given 2 ints, a and b, return their sum. However, sums in the range 10..19 inclusive, are forbidden, so in that case just return 20.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 889

Free response Unit 2: Selection and Iteration
Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, and a boolean indicating if we are on vacation, return a string of the form "7:00" indicating…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 890

Free response Unit 2: Selection and Iteration
The number 6 is a truly great number. Given two int values, a and b, return true if either one is 6. Or if their sum or difference is 6. Note: the function…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 881 of 3,140
Page 89 of 314