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.

Questions 71–80 of 100
  1. 71
  2. 72
  3. 73
  4. 74
  5. 75
  6. 76
  7. 77
  8. 78
  9. 79
  10. 80

Question 71

Multiple choice Algorithms
A programmer wants to use a binary search algorithm to search for a number in a list of numbers. For which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 72

Multiple choice Algorithms
What value does this procedure…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 73

Multiple choice Algorithms
For a certain service, users give ratings on a scale from 0.0 to 5.0. Ratings of 4.0 or greater are considered good, and ratings less than 4.0 are considered…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 74

Multiple choice Algorithms
The program should sum the odd integers from 1 through n, where n>1 is odd. For n=5, the sum should be 1+3+5=9. Which change repairs…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 75

Multiple choice Algorithms
len(str) returns the string length. What is displayed? nameList ←…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 76

Multiple choice Conditionals
🟢 🟥 ⚠️ Consider the following code segment, which selects songs from a database. select ← false IF (genre = "jazz") { IF (time 240) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 77

Multiple choice Algorithms
The robot starts in the bottom row facing up. It can enter white or…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 78

Multiple choice Boolean Expressions and Conditionals
🟢 🟥 ⚠️ The Boolean expression expression uses the variables input1 and input2. The table below gives the value of expression for three of the possible input…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 79

Multiple choice Algorithms
vals has 100 elements. The code displays whether vals is sorted from least to greatest. How should it change to detect greatest-to-least ordering? 1:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 80

Multiple choice Algorithms
countBottles(r) returns the number collected by room r; nonempty roomList contains school room numbers. The code should store the identifier of a room with the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 71 of 100
Page 8 of 10