Verityprep
Question Bank · Unit 4

AP® Computer Science Principles Algorithms and Programming Multiple Choice Questions

Work through AP Computer Science Principles multiple-choice questions on Algorithms and Programming, 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 41–50 of 100
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49
  10. 50

Question 41

Multiple choice Algorithms
A researcher predicts community births using ten years of population and birth data. The model…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 42

Multiple choice Conditionals and Loops
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 43

Multiple choice Algorithms
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 44

Multiple choice Conditionals and Loops
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 45

Multiple choice Conditionals and Loops
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 46

Multiple choice Algorithms
Each logic gate takes two inputs. For…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 47

Multiple choice Procedures
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 48

Multiple choice Conditionals and Loops
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 49

Multiple choice Conditionals and Loops
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 50

Multiple choice Procedures
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 41 of 100
Page 5 of 10