EBAY -- The Northern Version


Your mission is to write a client and server that implement a bidding system.  The server maintains a list of items and the current high bid for each item.  The clients can either get the list of items from the server, or submit a bid on an item.  To implement this the client and server share two commands.

The list command takes one argument, the number of the item.  The server sends back the current high price, or the letter 'E' if the item does not exist.

The bid command has two arguments.  The first number after bid is the item number and the second item is the price.  The server returns ether a 'Y' if the bid is accepted and the new current high bid, a 'N' if the bid is rejected because the bid was too low, and a 'E' if the bid s in error becasue the price or item number is invalid.



The Points Scheme
Points
Item
5
Client and server  know the list command
5
Client and server know the bid command
5
Client and server both handle error and send error messages.
5
Done before Thursday Oct 8th
-2
Per day after Tuesday Oct 14th

A sample dialog between the client and server is listed below.

    (client) "LIST 1" What is the price on item #1
    (server)"12.95" That price you asked is $12.95
    (client)"LIST 2" What is the price ifor item #3
    (server)"4.95" That price you asked about $4.95
    (client) "LIST 3" What is the price ifor item #3
    (server) "E" Error on your last question
    (client) "BID 1 10.03" Place a bid of $10.03 on item #1
    (server) "N" That bid is too low
    (client) "BID 2 10.03" Place a bid of $10.03 on item #2
    (server) "Y" Bid accepted
    (client) "BID 1034 10.11" Place a bid of $10.11 on item #1034
    (server) "E" That bid is in error.