Quiz 1

CS 29

40 pts., Feb. 13

Each question is worth 4 points.

  1. Why is the Internet like an Interstate?

    Both of them had military use among their reasons for creation; the Interstates for moving material and the Internet for communication.

  2. For what is telnet used?

    For remotely logging in to a remote computer across the Internet.

  3. Compare and contrast gopher and the World Wide Web.

    Gopher is text-based, whereas the WWW is multimedia.

  4. What is a protocol?

    A set of rules which, if followed, allow two networked computers to communicate.

  5. What distinguishes clients from servers?

    Clients make requests and servers service those requests.

  6. What does the following perl program print? Assume that the values entered for $balance, $transaction, and $action are 10, 5, and d, respectively.
    #!/usr/contrib/bin/perl
    
    print "Enter the account balance: ";
    $balance = <STDIN>;
    
    print "Enter the transaction amount: ";
    $transaction = <STDIN>;
    
    print "Enter d for deposit or w for withdrawal: ";
    $action = <STDIN>;
    chop($action);
    
    if ( $action eq "d" )
    {
        $balance = $balance + $transaction;
    }
    else
    {
        $balance = $balance - $transaction;
    }
    
    print "\nThe new balance is $balance.\n";
    
    exit 0;
    

    Here's what it prints:

    Enter the account balance:
    Enter the transaction amount:
    Enter d for deposit or w for withdrawal:
    
    The new balance is 15.
    

  7. In a perl program, to what does <STDIN> refer?

    Input from the keyboard.

  8. What is the shell?

    The program which procesess your commands and serves as a ``go between'' between you and the rest of the system.

  9. Give me some good, brief advice on choosing a good password.

    Eight characters or longer; includes uppercase, lowercase, numerals, and punctuation characters; is not a word in any dictionary; is not personal information.

  10. Here is a small part of a file system ``tree:''

    You just ran the pwd command and /users/kelliher was printed in response. Write a ``1'' in the circle corresponding to that response. Next, you type and run the following commands:

    cd ..
    cd ..
    cd contrib
    
    Write a ``2'' in the circle corresponding to your new position within the file system tree.



Thomas P. Kelliher
Wed Feb 19 09:28:33 EST 1997
Tom Kelliher