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 121–130 of 329
  1. 121
  2. 122
  3. 123
  4. 124
  5. 125
  6. 126
  7. 127
  8. 128
  9. 129
  10. 130

Question 121

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 122

Free response Unit 2: Selection and Iteration
You have a blue lottery ticket, with ints a, b, and c on it. This makes three pairs, which we'll call ab, bc, and ac. Consider the sum of the numbers in each…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 123

Free response Unit 2: Selection and Iteration
Given two ints, each in the range 10..99, return true if there is a digit that appears in both numbers, such as the 2 in 12 and 23. (Note: division, e.g. n/10,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 124

Free response Unit 2: Selection and Iteration
Given 2 non-negative ints, a and b, return their sum, so long as the sum has the same number of digits as a. If the sum has more digits than a, just return a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 125

Free response Unit 2: Selection and Iteration
We want to make a row of bricks that is goal inches long. We have a number of small bricks (1 inch each) and big bricks (5 inches each). Return true if it is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 126

Free response Unit 2: Selection and Iteration
Given 3 int values, a b c, return their sum. However, if one of the values is the same as another of the values, it does not count towards the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 127

Free response Unit 2: Selection and Iteration
Given 3 int values, a b c, return their sum. However, if one of the values is 13 then it does not count towards the sum and values to its right do not count. So…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 128

Free response Unit 2: Selection and Iteration
Given 3 int values, a b c, return their sum. However, if any of the values is a teen -- in the range 13..19 inclusive -- then that value counts as 0, except 15…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 129

Free response Unit 2: Selection and Iteration
For this problem, we'll round an int value up to the next multiple of 10 if its rightmost digit is 5 or more, so 15 rounds up to 20. Alternately, round down to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 130

Free response Unit 2: Selection and Iteration
Given three ints, a b c, return true if one of b or c is "close" (differing from a by at most 1), while the other is "far", differing from both other values by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 121 of 329
Page 13 of 33