WWWP Exam:

Mid-term




  1. [30%] A common WWW practice is for a user to click on an anchor in a page shown in a browser and, shortly later, a form appears. The user then types information (e. g., a search request) into the form and selects a submit button. After a few moments, a page of information (e. g., search results) is displayed, apparently in response to the data entered into the form.

    What , exactly, is going on here? Answer the question by addressing the following two points. Refer to Figure 1 in writing your answer.

    Figure 1:
    WWW Architecture



    1. Trace the flow of messages/data that occurs in this scenario.

    2. What protocols or communication conventions are used in those parts of Figure 1 that are labeled Internet and CGI ? Give brief, but plausible, examples of what a message at the highest level of protocol or convention would look like at those two points (e. g., not the IP level).

  2. [30%] Write comments for each executable statement in the following Perl program; explain briefly, but comprehensively, what each statement is doing. (You may write on this page.)

    #!/usr/local/bin/perl
    #
    $qs = "name_var=%28+john+++smith%29&submitbutton=submit";
    
    #DEPLUS
    $qs =~ tr/\+/ /s;
    
    #TOKENIZE
    @av_strings = split(/&/, $qs);
    
    #SPLIT
    foreach $avs (@av_strings) {
    
    @av_pair = split(/=/, $avs);
    
    $attr_value{$av_pair[0]} = $av_pair[1];
    }
    
    #DECODE
    foreach $key (keys %attr_value) {
    
    $key =~ s/%(..)/pack("c",hex($1))/ge;
    
    $attr_value{$key} =~ s/%(..)/pack("c",hex($1))/ge;
    }
    


  3. [40%] Explain briefly (3 - 4 sentences) the following concepts, within the context of Java. Illustrate each with a brief segment of syntactically-correct Java code.

    1. class

    2. method

    3. object

    4. inheritance

    5. method override

    6. event

    7. package

    8. Java.awt.Component




Pledge: I have neither given nor receive unauthorized aid on this exam.

Signed: __________________________


email: jbs@cs.unc.edu
url: http://www.cs.unc.edu/~jbs/

Go to course homepage