Web Database Midterm

  1. When a web user (a person) clicks on a link, what happens first? (pick one)
    1. The browser contacts the appropriate server
    2. The server tells the browser what page to load
    3. The operating system offers a web page to the client
    4. All dogs go to heaven
  2. Why do web browser keep a cache (pick all that apply)
    1. To speed access to commonly used pages
    2. To reduce network load
    3. To store information about the user's dog.
    4. To reduce server load
    5. To record what pages a particular user has accessed
  3. Sometimes clients will verify a cached page with the server before using the cached page.  Why?
    ________________________________________________________________________________
    ________________________________________________________________________________
  4. Suppose a client can access a cached page in 20 milliseconds.  The same client can download a page over the network in 100 milliseconds.  It takes another 100 milliseconds to display a page, regardless of source.  The cache hit rate is 50%.  How long on average does it take to show a page.
    __________________________________________________________________________________
    __________________________________________________________________________________
  5. HTTP Stuff (3 points)

  6. What is transferred in the header of an HTTP request? (pick all that apply)
    1. The content type
    2. The file name
    3. The length
    4. The author's dogs name
  7. What is the big advantage of HTTP/1.1 over HTTP/1.0 (pick one)
    1. The correctness of the data is verified, reducing errors.
    2. Encryption protects all data transferred.
    3. Caching is allowed.
    4. More than one request can be sent over a connection.
  8. Suppose a file has 1000 bytes.  How much network traffic is generated when sending the file? (choose all the apply)
    1. Less than 1000 bytes if HTTP/1.1's compression is used
    2. More than 1000 bytes; there's a header you know
    3. Exactly 1000 bytes.  HTTP is designed to be optimal in data transmission terms.
    4. Dogs love bacon
    5. Depends on the latency of the underlying network.  Fast networks use less than 1000 bytes, but slow networks need more.

    HTML Stuff (9 points)

  9. Suppose you have large section of text, all of which has spaces that need to be preserved, and is already formatted perfectly.  What tag should you use to preserve the existing format for this text? ________________________________
  10. (3 points) Write me a correct web page that displays you name in the middle of the screen, and as a title on the window's title bar.















  11. (True/False) A physical format describes what text looks like, and a logical format describes the content of the text.
  12. The difference between a check box and a radio button is(pick all that apply)
    1. More than one check box can be set at a time, no two radio buttons of the same name can be set at once.
    2. Radio buttons are normally displayed horizontally, check boxed vertically
    3. Dogs love trucks
    4. Radio buttons can be partially set, check boxes are either on or off.
    5. Check boxes are a logical format, radio buttons are a physical format
  13. (3 points) Write me a correct web page that
  14. Perl Stuff (11 points)

  15. (True/False) Variables that start with a '$' are strings, and '%' means numbers
  16. (3 points) Write a some code that prints out the contents of the normal array 'fred'.  There are ten elements numbered 0 ... 9













  17. Which will be faster at finding an element of an associative array given it's key value?
    1. An array tied to a hash table file
    2. An array tied to a normal text file
    3. An array tied to the tail of a dog
  18. (3 points) A form sends data to a cgi script.  The script prints the value of a text area named 'dog'. Write that script.




















  19. (3 points) Write a perl script that looks in a file as shown below and prints ou the age of the dog named 'fido'.

  20. Snoopy,                        Charley Brown,             10
    Woody,                         Chris Christophseron, 3
    Haggared,                    Charles Manson,           12
    Killer,                           Charles Barkley,           5