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 901–910 of 3,140
  1. 901
  2. 902
  3. 903
  4. 904
  5. 905
  6. 906
  7. 907
  8. 908
  9. 909
  10. 910

Question 901

Free response Unit 2: Selection and Iteration
Given an int n, return the string form of the number followed by "!". So the int 6 yields "6!". Except if the number is divisible by 3 use "Fizz" instead of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 902

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if it is possible to add two of the ints to get the third. twoAsOne(1, 2, 3) → true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 903

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if b is greater than a, and c is greater than b. However, with the exception that if "bOk" is true, b does not need to be…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 904

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if they are in strict increasing order, such as 2 5 11, or 5 6 7, but not 6 5 7 or 5 5 7. However, with the exception that…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 905

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if two or more of them have the same rightmost digit. The ints are non-negative. Note: the % "mod" operator computes the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 906

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if one of them is 10 or more less than one of the others. lessBy10(1, 7, 11) → true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 907

Free response Unit 2: Selection and Iteration
Return the sum of two 6-sided dice rolls, each in the range 1..6. However, if noDoubles is true, if the two dice show the same value, increment one die to the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 908

Free response Unit 2: Selection and Iteration
Given two int values, return whichever value is larger. However if the two values have the same remainder when divided by 5, then the return the smaller value.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 909

Free response Unit 2: Selection and Iteration
You have a red lottery ticket showing ints a, b, and c, each of which is 0, 1, or 2. If they are all the value 2, the result is 10. Otherwise if they are all…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 910

Free response Unit 2: Selection and Iteration
You have a green lottery ticket, with ints a, b, and c on it. If the numbers are all different from each other, the result is 0. If all of the numbers are the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 901 of 3,140
Page 91 of 314