WorksheetsComp Sci Unit 3 #12
Total questions: 10
Worksheet time: 5mins
A new bank plans to make customer convenience a priority by minimizing the amount of time a customer waits in line. The bank is considering two options: a single line where the customer at the front waits for the next available teller, or separate lines for each teller. The bank decides to use a computer simulation of these two options to determine the average wait time for customers.
Which of the following is NOT true about the bank’s plan?
The bank can incorporate other factors, such as the number of tellers, in the simulation.
The bank can use the simulation to investigate these two options without causing inconvenience for customers.
The bank may consider new alternatives based on the simulation results.
The simulation will not produce usable results because actual customer data are not available.
Assume that both lists and strings are indexed starting with index 1.
The list wordList has the following contents.
["abc", "def", "ghi", "jkl"]
Let myWord be the element at index 3 of wordList. Let myChar be the character at index 2 of myWord. What is the value of myChar ?
"e"
"f"
"h"
"i"
Which of the following is a benefit of using a list as a data abstraction in a program?
Lists often allow their size to be easily updated to hold as many data values as needed.
Lists convert all elements to strings so that they can be inspected character-by-character.
Lists prevent duplicate data values from appearing in the list.
Lists are used to store all input data so that there is a running record of all user input.
In which of the following scenarios would a simulation be the LEAST beneficial?
An engineering company wants to test whether a change to a car design will negatively affect fuel efficiency.
An insurance company wants to study the effect of cold weather patterns on health-care costs.
A manufacturing company wants to determine whether using robots in its facility will increase productivity.
A retail company wants to determine the most popular item that was sold on the company’s Web site last month.
In which of the following scenarios is using a simulation more beneficial than performing a calculation?
Select two answers.
Determining the average grade of the students in a certain class
Keeping track of the high score in a game
Investigating ways to reduce the amount of trash in the ocean
Studying the effect of a genetic change in a population
For which of the following problems is using a simulation LEAST likely to be beneficial?
Determining the longest word in a textbook
Minimizing the customer wait times at a bank
Predicting the outcomes of weather patterns
Studying the formation of a galaxy
A scientist wants to investigate several problems. In which of the following situations is using a simulation LEAST suitable for solving a problem?
When a scientific study requires performing a large number of trials that need to be conducted very quickly
When it is considered acceptable to make simplifying assumptions when modeling a real-world object or phenomenon
When performing an experiment that would be too costly or dangerous to conduct in the real world
When the solution to the problem requires real-world data inputs that are continually measured at regular intervals.
Consider the following code segment.
What are the contents of yourList after the code segment is executed?
[10, 30, 50, 70]
[20, 40, 60, 80]
[10, 30, 50, 70, 20, 40, 60, 80]
[20, 40, 60, 80, 10, 30, 50, 70]
The transportation department plans to build a new high-speed train route between two cities. The transportation department wants to implement a simulation of the train before any construction begins on this project. Which of the following statements is true about the use of a simulation for this project?
A simulation cannot be used to test the train under varying weather conditions.
Implementing a simulation is likely to increase the overall costs associated with the project.
Other high-speed train routes have been constructed in other locations, so a simulation is not needed.
Using a simulation may expose potential safety issues that can be corrected before construction begins.
A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of using a list as a data abstraction in this situation?
Keeping the numeric values in a list makes it easier to round a number to the nearest integer.
Keeping the numeric values in a list makes it easier to apply the same computation to every data element.
Keeping the numeric values in a list makes it easier to prevent a program from unintentionally changing the value of a variable.
Keeping the numeric values in a list makes it easier to prevent a program from attempting to access an index beyond the length of the list.
