Verityprep
Question Bank

AP® Computer Science A FRQ Practice: Free-Response Questions with Solutions

Work through AP Computer Science A free-response 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 111–120 of 329
  1. 111
  2. 112
  3. 113
  4. 114
  5. 115
  6. 116
  7. 117
  8. 118
  9. 119
  10. 120

Question 111

Free response Unit 2: Selection and Iteration
Given a string str, if the string starts with "f" return "Fizz". If the string ends with "b" return "Buzz". If both the "f" and "b" conditions are true, return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 112

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 113

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 114

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 115

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 116

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 117

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 118

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 119

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 120

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 111 of 329
Page 12 of 33