Chris Pollett >
Old Classes >
PIC40

   ( Print View )

Lecture Notes-PDF

Spring '01 Ad: Enrollment info

Course Info: Homework Assignments:
Practice Exams:
PIC:
                           












PIC 40 Practice Final

What to expect from the real thing:
===================================

The real final will be in class, closed book, closed notes and have seven
problems of approximately the same difficulty as those below. Each problem
will be worth 5pts. One of the problems below is guaranteed to be on the
actual final. To minimize the chaos at the start and end of the test and
also to ensure everyone gets to work on the test the same amount of time,
there is an enforced two point penalty for starting the test before I say
begin or after I say stop.

What to bring:
==============
Remember to bring your Student ID. Remember to leave any cell phones, pagers,
or other things that go beep at home.

Practice Problems:
==================

1. Write the .htaccess needed to get SSI directives to work for files with .html
extensions. Then write a short html file named hello.html which prints
its last modification date, includes the file bob.html and exec's
hello.cgi.

2. Write a cgi script which when run open a file (not a dbm) named
raddresses and write to it the remote address of the person who accessed
this cgi.

3. (a) Discuss the three enctype's for HTML forms described in class. (b)
Distinguish between how GET and POST forms work.

4. (a) Explain how to set and read the cookie named book with value
   "War and Peace" in Perl. (b) In PHP.

5. Suppose we have a library database which has tables: Book[title,author,
   callno] and Checkout[callno, MemberId, dueDate].

   Write an SQL query to return the titles of all books with author
   like 'Tolstoy' that have been checked out.


6. Write the PHP needed to connect to a MySQl database named airtransportation
   with username pic40 and password pic40 and print out all the rows in
   the table Flight.

7. Explain how to use Javascript to check if a text element named fourwide
   had a least four characters in it before a form could be submitted.

8. Give an example of the html needed to create a hidden field. What are
   such fields good for?

9. Write the HTML and Javascript needed to have an image link that alternates
   between the images bob1.gif and bob2.gif depending on whether the mouse is
   over the link or not.

10. Write the Perl needed to check if the file hash.dir exists and if so
    to open the corresponding DBM hash and add one to the value
    corresponding to the key TOO_SMALL.