Final Exam - CSE100 - Autumn 2000 - Answer Key

This exam is 80 points total.

  1. (30 points total for this question). Definitions. First is a list of IT words and phrases, and following that is a list of possible definitions or things that are true about a word or phrase. For each word or phrase in the first list, write down the number of the correct definition or fact from the second list. For example, next to "byte" you should write "b" (since a byte is 8 bits, and that's the Possible Definition labelled "b"). You can use the definitions and facts more than once. Thus, you should also write "b" next to "just enough bits to store numbers between 0 and 255", since 8 bits is just enough for this. (So everyone should get at least two of these questions right!) However, just write one answer next to each word or phrase in the first list. Two or more answers next to a word or phrase will be marked as incorrect.

    Here is the list of IT words and phrases. Write a letter (from the second list) next to each of these.

    Here is the list of possible definitions or things that are true. Just use this as the source of numbers to write down next to each item on the first list -- you don't need to write anything next to these.

    1. 1 bit
    2. 8 bits
    3. something vampires do
    4. a test of whether a computer can think
    5. a safety net to catch medical professionals (entered in the MedPros table) who pass out in the operating room from inhaling too much ether
    6. a database operation that combines two tables by concatenating records that match on their common attributes
    7. boris.cs.washington.edu is an example
    8. a database operation that picks certain rows from a table based on a given test
    9. a representation of a color value in terms of the amount of Red, Green, and Blue
    10. </h2> matches this
    11. an internet transfer protocol involving Routing, Gateways, and Block-based transmission of information
    12. a technology for local area networks (LANs)
    13. Asynchronous Sequential Computer Information Interchange (an internet protocol)
    14. a kind of iteration statement
    15. address of the law office of an Intellectual Property lawyer
    16. a kind of conditional statement
    17. by one story, it was a moth, stuck in a relay
    18. an HTML tag
    19. American Standard Code for Information Interchange (a standard encoding for characters)
    20. 128.95.2.227 is an example
    21. a public key encryption system
    22. a property that algorithms must have
    23. a property of main memory but not of disk memory
    24. a step in the fetch/execute cycle
    25. a spider, found lodged in the keyboard of the Harvard Mark II laptop computer
    26. one of the principal components of a computer

  2. (5 points) Suppose we have an integer array x, declared as follows.
    Dim a(1 To 1000) As String
    
    Write Visual Basic statements to set each element in the array to the string "clam".

    
    Dim i As Integer
    for i=1 to 1000
       a(i) = "clam"
    next i
    
    
    There is an error on the first line, which should read "Suppose we have an string array a, declared as follows." Unfortunately nobody noticed this until the exam was almost over. Since quite a few people got it right, just throwing the question out didn't seem fair, so we went ahead and graded it but were lenient with small errors, particularly in the declarations.

  3. (5 points) In the Game of Life, if you start with this state:
           ***
    
    what is the state after one step?
            *
            *
            *
    

  4. (5 points) Why is redundancy bad in a relational database? (Hint: one reason is that it wastes space, but there is a second, more important, reason.)

    Inconsistency is the primary reason: If information appears in more than one place in the database, it can become inconsistent, e.g. if it is changed in one place but not the other(s).

  5. (5 points) In Project 4 (the CDC database), the Clients table has a field ClientID that is the key field. The Visits table also has a field ClientID. What is the relation between the Clients.ClientID and Visits.ClientID fields? Circle the correct answer. one to many

  6. (20 points) True or false?
    1. To send a long e-mail message over the internet, it may be broken up into several packets. Each packet travels the same route through the network, to the destination IP address on the packet. False
    2. An algorithm must terminate. True
    3. An expression may be used as the formal parameter for a procedure. False
    4. An expression may be used as the actual parameter for a procedure. True
    5. In the fetch/execute cycle, the processor must fetch the data before fetching the instruction. False
    6. A typical machine instruction, such as ADD 200, 300, 500, adds 200 and 300, and verifies that the sum is 500. False
    7. The CSE 100 turnin program is invariably reliable, usable, available, accurate, and able to accomodate large files without complaint. False
    8. A Visual Basic variable of type Integer can hold both positive and negative numbers, but not a fractional number such as 1/2. True
    9. A Do While loop in Visual Basic always executes the statements in the body of the loop at least once. False
    10. If you use binary search to search 1000 items, the search will need to look at 500 items on the average. False

  7. (5 points) What is the output generated when the Form_Click event handler runs?
    Private Sub Form_Click()
       Dim m As Integer, n As Integer
       m = 5
       Call clam(m,3,n)
       Print n
    End Sub
    
    Private Sub clam(x As Integer, y As Integer, z As Integer)
      z = x+y
    End Sub
    
    It prints 8.
  8. (5 points) Consider the following Visual Basic statements. How many squids does this print? (Hint: this is a slightly tricky question, so read the code carefully.)
    
    Dim i As Integer, j As Integer
       For i=1 to 3
          For j=1 to i
             Print "squid"
          Next j
       Next i
    
    6 squids