Verityprep
Question Bank · Unit 4

AP® Computer Science Principles Algorithms and Programming Practice Questions

Work through AP Computer Science Principles practice 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.

Subtopic: Algorithms Clear filter

Questions 41–49 of 49
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49

Question 41

Multiple choice Algorithms
Choose two of 28 students so every pair is equally likely. Initially assign unique labels 1–28. Generate j uniformly from 1–28 and have student j…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 42

Multiple choice Algorithms
A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of goats and sheep throughout the text.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 43

Multiple choice Algorithms
The robot initially occupies bottom-left and faces right. Which diagram shows its final position…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 44

Multiple choice Algorithms
The robot in each grid starts facing left. It may enter white or shaded cells but not black cells. GoalReached() is true on the shaded cell. For which grid does…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 45

Multiple choice Algorithms
A computer system has the task times below. Based on the observed growth, which task is likely to take the longest for approximately 100000…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 46

Multiple choice Algorithms
onTime and absent are both false. What is displayed? IF(onTime){DISPLAY("Hello.")}…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 47

Multiple choice Algorithms
Under which of the following conditions is it most…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 48

Multiple choice Algorithms
Two algorithms find the mean height of 32 students. Which statement is true? Algorithm A: 1. All students stand. 2. One randomly selected student writes their…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 49

Multiple choice Algorithms
morningList and afternoonList contain children attending each camp session. Only children in both sessions eat lunch.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 41 of 49
Page 5 of 5