Computer Science Principles Unit #5
Test Exam Questions With 100%
Verified Answers
1. A school is developing a program to keep track of information
about students and their class schedules. In which of the following
instances would a data abstraction be most helpful? -
correct answer ✅A. The program includes individual variables to
store the names of each student rather than a single list of
students.
2. Which of the following will not result in an error if placed where
the program reads <INSERT CODE> and the program is run? -
correct answer ✅B. i < list.length
3. wordList is a list of words that currently contains the values
["tree", "rock", "air"]. Which of the following lines will result in the
list containing the values ["air", "rock", "air"]? -
correct answer ✅a. wordList[0] = wordList[2]
4. What will be displayed in the console when this program runs? -
correct answer ✅D. 30
5. What will be displayed when this program finishes running? -
correct answer ✅D. 5
, Computer Science Principles Unit #5
Test Exam Questions With 100%
Verified Answers
6. What will be displayed in the console when the following
program runs? -
correct answer ✅D. The program will result in an infinite loop
7. What will the following program display in the console? -
correct answer ✅A. 0 1 2 3
8. What will the following program display in the console? -
correct answer ✅C. 10
9. The following question uses a robot in a grid of squares. The
robot is represented by a triangle, which is initially facing up. Which
of the following programs will move the robot to the gray square
following the path shown on the grid? -
correct answer ✅A.Both program I and program II correctly move
the robot to the gray square.
10. ageList and grade.list contain information about students in a
classroom. A programmer has already written the following code
with that information. Which of the following programs will result
Test Exam Questions With 100%
Verified Answers
1. A school is developing a program to keep track of information
about students and their class schedules. In which of the following
instances would a data abstraction be most helpful? -
correct answer ✅A. The program includes individual variables to
store the names of each student rather than a single list of
students.
2. Which of the following will not result in an error if placed where
the program reads <INSERT CODE> and the program is run? -
correct answer ✅B. i < list.length
3. wordList is a list of words that currently contains the values
["tree", "rock", "air"]. Which of the following lines will result in the
list containing the values ["air", "rock", "air"]? -
correct answer ✅a. wordList[0] = wordList[2]
4. What will be displayed in the console when this program runs? -
correct answer ✅D. 30
5. What will be displayed when this program finishes running? -
correct answer ✅D. 5
, Computer Science Principles Unit #5
Test Exam Questions With 100%
Verified Answers
6. What will be displayed in the console when the following
program runs? -
correct answer ✅D. The program will result in an infinite loop
7. What will the following program display in the console? -
correct answer ✅A. 0 1 2 3
8. What will the following program display in the console? -
correct answer ✅C. 10
9. The following question uses a robot in a grid of squares. The
robot is represented by a triangle, which is initially facing up. Which
of the following programs will move the robot to the gray square
following the path shown on the grid? -
correct answer ✅A.Both program I and program II correctly move
the robot to the gray square.
10. ageList and grade.list contain information about students in a
classroom. A programmer has already written the following code
with that information. Which of the following programs will result