Spring Semester 2004


Midterm Exam: What, When, Where, Why. How.

The midterm will be in class on March 5 (Thu) during the lecture.

Here's the problem you received in class:

(A Simple Vending Machine)

Implement a web script that would behave more or less like this:

prompt> java Vendor
Welcome. We sell stamps ($3.40) Please enter money:
enter> nickel nickel dollar dollar quarter
Thanks. Your credit is $2.35 I need $1.05 more.  
enter> cent cent
Thanks. Your credit is $2.37 I need $1.03 more. 
enter> dollar quarter
Thanks. Your credit is $3.62 The stamps are yours.
Your change is: $0.22
Thanks for using this program. 
This being a web script, it should provide the behaviour of your calculator.

So your program developed in class is worth 40% of the Midterm Grade.

Implementing the program above in four different ways:

  1. CGI/Perl with state on the server side (MySQL)
  2. CGI/Perl with state on the client side
  3. PHP with state on the server side (sessions)
  4. PHP with state on the client side

and posting the programs with their source code by Tue-Thu next week will give you the rest 60%.


Last updated: Mar 5, 2004 by Adrian German for A348/A548