Verityprep
Question Bank

AP® Computer Science Principles Multiple Choice Questions

Work through AP Computer Science Principles multiple-choice 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 161–170 of 214
  1. 161
  2. 162
  3. 163
  4. 164
  5. 165
  6. 166
  7. 167
  8. 168
  9. 169
  10. 170

Question 161

Multiple choice Unit 4: Algorithms and Programming
What value does this procedure…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 162

Multiple choice Unit 4: Algorithms and Programming
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 163

Multiple choice Unit 4: Algorithms and Programming
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 164

Multiple choice Unit 4: Algorithms and Programming
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 165

Multiple choice Unit 4: Algorithms and Programming
🟢 🟥 ⚠️ 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 166

Multiple choice Unit 4: Algorithms and Programming
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 167

Multiple choice Unit 4: Algorithms and Programming
🟢 🟥 ⚠️ 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 168

Multiple choice Unit 4: Algorithms and Programming
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 169

Multiple choice Unit 4: Algorithms and Programming
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 170

Multiple choice Unit 4: Algorithms and Programming
characterList stores single-character strings. Uppercase letters occupy indices 65 through 90. concat(string1,string2) joins two strings; for example…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 214
Page 17 of 22