Name: Score:
27 Multiple choice questions
Term 1 of 27
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 procedure returns true when the initial value of number is even, and it otherwise
returns false.
Algorithm ii always works correctly, but algorithm i only works correctly when the maximum
value is greater than or equal to -1.
The simulation will not produce usable results because actual customer data are not
available.
The program correctly displays the count of even numbers between 1 and number.
,Term 2 of 27
r←1
s←2
t←3
r←s
s←t
DISPLAY (r)
DISPLAY (s)
What is displayed as a result of running he code segment?
34
13
12
23
, Term 3 of 27
Programs I and II below are each intended to calculate the sum of the integers from 1 to n.
Assume that n is a positive integer.
Program I:
i←1
result ← 0
REPEAT n TIMES
result ← result + i
i←i+1
DISPLAY result
Program II:
i←n
result ← 0
REPEAT n TIMES
result ← result + i
i←i-1
DISPLAY result
Which of the following best describes the behavior of the two programs?
Program 1 displays the correct average, but Program 2 doesn't.
NOT vaultClosed OR (heardNoise OR sawMovement)
The program could display either true or false.
Both Program I and Program II display the correct sum.
27 Multiple choice questions
Term 1 of 27
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 procedure returns true when the initial value of number is even, and it otherwise
returns false.
Algorithm ii always works correctly, but algorithm i only works correctly when the maximum
value is greater than or equal to -1.
The simulation will not produce usable results because actual customer data are not
available.
The program correctly displays the count of even numbers between 1 and number.
,Term 2 of 27
r←1
s←2
t←3
r←s
s←t
DISPLAY (r)
DISPLAY (s)
What is displayed as a result of running he code segment?
34
13
12
23
, Term 3 of 27
Programs I and II below are each intended to calculate the sum of the integers from 1 to n.
Assume that n is a positive integer.
Program I:
i←1
result ← 0
REPEAT n TIMES
result ← result + i
i←i+1
DISPLAY result
Program II:
i←n
result ← 0
REPEAT n TIMES
result ← result + i
i←i-1
DISPLAY result
Which of the following best describes the behavior of the two programs?
Program 1 displays the correct average, but Program 2 doesn't.
NOT vaultClosed OR (heardNoise OR sawMovement)
The program could display either true or false.
Both Program I and Program II display the correct sum.