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.
B. i < list.length
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]
What will be displayed in the console when this program runs?
D. 30
What will be displayed when this program finishes running?
D. 5
What will be displayed in the console when the following program runs?
D. The program will result in an infinite loop
What will the following program display in the console?
A. 0 1 2 3
What will the following program display in the console?
C. 10
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.
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.
If the program above is run, what will be displayed in the console?
B
D.
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.
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.
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?
B.