Quiz 3 answers CSE100, Autumn 1999
This quiz is out of 10 points.


1. Using the loop

        index = 0
        Do While index < 7
                dwarfName(index) = "Mr. " & dwarfName(index)
        Loop


give an example of

(a) An iteration variable
(b) A termination test
(c) An array variable


(a) index
(b) index < 7
(c) dwarfName


2. 2. What does it mean to say a computer is "universal"?
Universality: Any problem solvable by some computer can be solvable by any computer

3. There is a bug in the loop of problem #1. What is the bug?
The loop doesn't terminate (to fix this, one may increment index in the body of the loop)

4. If a binary search program requires x guesses to determine an answer over an interval of y items (e.g. the Day Find used 5 guesses to determine a birthdate over an interval of 32 dates), how many guesses will it take if the size of the interval is doubled?
x+1
(One more guess is required for twice as much data)