Send a link to your students to track their progress
15 Terms
1
New cards
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?
A. The program includes individual variables to store the names of each student rather than a single list of students.
2
New cards
2. Which of the following will not result in an error if placed where the program reads and the program is run?
B. i < list.length
3
New cards
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"]?
a. wordList[0] = wordList[2]
4
New cards
4. What will be displayed in the console when this program runs?
D. 30
5
New cards
5. What will be displayed when this program finishes running?
D. 5
6
New cards
6. What will be displayed in the console when the following program runs?
D. The program will result in an infinite loop
7
New cards
7. What will the following program display in the console?
A. 0 1 2 3
8
New cards
8. What will the following program display in the console?
C. 10
9
New cards
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?
A.
10
New cards
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 in filteredNames only containing the names of students who are 17 or older?
D.
11
New cards
11. If the program above is run, what will be displayed in the console?
B
12
New cards
12. A program is designed to determine the minimum value in a list of positive numbers called numList. The following program was written. Which of the following can be used to replace so that the program works as intended for every possible list of positive numbers?
D.
13
New cards
13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails". The program below simulates randomly flipping that coin many time. Which of the following is NOT a possible combination of values of the variables in this program when it finishes running?
C.
14
New cards
14. A restaurant knows from historical data that 60 out of 100 of its customers purchase a full meal while 40 out of 100 only order a side dish. The program below is intended to simulate the orders of 1000 customers.
D.
15
New cards
15. A job placement agency helps match job seekers with potential employers. The agency would like to design a simulation in order to help predict the likely job placement outcomes for job seekers based on historical trends and patterns. Which of the following is most likely to be a benefit of the simulation?