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 921–930 of 3,140
  1. 921
  2. 922
  3. 923
  4. 924
  5. 925
  6. 926
  7. 927
  8. 928
  9. 929
  10. 930

Question 921

Free response Unit 2: Selection and Iteration
Given three ints, a b c, one of them is small, one is medium and one is large. Return true if the three values are evenly spaced, so the difference between…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 922

Free response Unit 2: Selection and Iteration
We want make a package of goal kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Return the number of small bars to use,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 923

Multiple choice Unit 2: Selection and Iteration
Vehicles are classified based on their total interior volume. The classify method is intended to return a vehicle classification String value based on total…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 924

Multiple choice Unit 2: Selection and Iteration
Which of the following best describes the value of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 925

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int val = 48; int div = 6; while ((val % 2 == 0) && div > 0) { if (val %…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 926

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int x = / * some integer value * /; int y = / * some integer value * /; if (x > y && x % 2 == 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 927

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. Assume that x and y are properly declared and initialized integer variables. int z = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 928

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. int n = 0; while (n < 10) { n += 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 929

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. Assume that value is a properly declared and initialized integer variable. if (value < 7) { value + = value;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 930

Multiple choice Unit 2: Selection and Iteration
Consider the following code segment. for (int j = 0;j <= 3;j++) { for (int k = 0;k < 3;k++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 921 of 3,140
Page 93 of 314