CS 460 -- The Test of Champions


1) When using HTTP, what's the relationship between a 'hit' and an actual user looking at the page on an actual screen.  (Circle all that apply)
    Hits could be more
    Actual human views could be more
    Ninety percent or more of the time they are equal


2) (Yes/No) Can a Perl/CGI program produce a picture like a JPG or GIF as output?

3) What is the HTTP error code for "Page not found"?

4) Can a PHP program tell what kind of browser is requesting the page? (Circle all that apply)
    Yes
    Yes, but they might lie
    No, it's typicaly not sent
    No,it's never sent that's not part of the protocol.

5) What does this Perl code print?
    $a = "Hello there fred";
    $a =~ s/e/x/g;
    print $a


6) Assuming that 'fred' is a Perl variable, what does $#fred mean?


7) In PHP, where in your code can you set a cookie into the browser?


8) What does this Perl command do?
    WHEETIES=open("box-of-cereal |");


9) Using the 'planes' table of the 'nations database, which plane has more nations that use it, the MiG-21 or the F-16?

10) Using the nations database and DOING A JOIN, which nations amoung those using MiG-21s has the highest GDP?

11) Suppose a file has 1000 bytes.  Assume nothing is cached.  How much network traffic is generated when sending the file? (choose all the apply)
    1. Less than 1000 bytes
    2. More than 1000 bytes;
    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.
12) I have a large picture of my son' birthday.  Assuming reasonable things, which picture format will use less space?
    PNG
    JPG



----------------------
Write me a program that prints every word with two vowels in a row in /usr/share/dict/words.  Be careful to count both upper and lower case letters.  'Y' counts as a vowel.  Two points. 

Write me a program that offers a web form.  When the user enters a plane, the script prints every nation using that plane.  One point for the basics, anothr if you can print nation names and not nation codes, and a third if this is in order by national name.