Verityprep
Question Bank

AP® Computer Science Principles Practice Questions

Work through AP Computer Science Principles 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 131–140 of 214
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice Unit 4: Algorithms and Programming
The robot starts facing right. Which code moves it to the shaded goal? PROCEDURE…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice Unit 4: Algorithms and Programming
Byte-pair encoding replaces repeated adjacent character pairs with otherwise unused characters and saves the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice Unit 4: Algorithms and Programming
The robot initially faces up and may enter white or shaded cells but not black cells. GoalReached() is true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Multiple choice Unit 4: Algorithms and Programming
The guessing-game loop never terminates. Where should win ← true be inserted to make it work as intended? 1: secretNumber ← RANDOM(1,100) 2: win ← false 3:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 135

Multiple choice Unit 4: Algorithms and Programming
Each logic gate takes two inputs. For…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice Unit 4: Algorithms and Programming
The robot starts at bottom-right facing up. Both programs intend to reach the shaded square. Which statement is true? Program I: REPEAT 4 TIMES…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

Multiple choice Unit 4: Algorithms and Programming
An apartment rental site uses this flowchart to assign include. Which statement is equivalent? Symbol…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 138

Multiple choice Unit 4: Algorithms and Programming
A researcher simulates mice in an environment with predators. Which assumption is made by this program? days ← 0 numMice ← InitialMousePopulation() numPredators…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 139

Multiple choice Unit 4: Algorithms and Programming
Both programs intend to display the average of numList, which contains more than one value. Which statement is correct? Program I: sum ← 0 FOR EACH num IN…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 140

Multiple choice Unit 4: Algorithms and Programming
Every tenth snack-bar purchase is free. GetCount(customerID) returns the customer’s number of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 131 of 214
Page 14 of 22

AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.