6515 S '11
Project 1
Project 2
Project 3
Project 4
Project 5
Project 6
Project 7
Project 8
Project 9
Project 10
Project 11
Project 12
Project 13

Project 2

Due date: 1/21 : NOON, in SVN

Objective: to confirm a certain level of comfort with your chosen language

Tasks: You are to design two modules:

  1. a GUI client that spawns a 200 x 200 canvas and that records the X and Y coordinates of all user mouse clicks until the user hits "q" on the keyboard;
  2. an XML module that provides functions for rendering sequences of X and Y coordinates as XML and for turning the XML representation of such sequences as sequences again.
It is your task to design the internal representation of sequences of points with X and Y coordinates; the XML representation is specified below.

Using these modules you are to design two additional modules:

  1. The first one uses the GUI to acquire a sequence of points with X and Y coordinates and then "logs" them to the standard output (STDOUT) in Unix.
  2. The second one uses the GUI to acquire a sequence of points, sends them as XML messages via TCP to a local server at port 32123, and prints the response of the server to the local output. Assume that the response is an XML representation of sequences of points.

We will run a local server that reads your XML representation of sequences of points and returns a sequence with the values of the X and Y coordinates swapped for each point.

You must demonstrate your basic familiarity with the PDP design process. We will focus on two aspects in particular: unit tests and purpose statements. That is, each module must come with unit tests that demonstrates your familiarity with the language's unit testing mechanism. Furthermore, each function/method must come with a purpose statement.

XML Messages: Your XML representation of sequences of points must have the following shapes:
General Example
 <point x=NatStr y=NatStr /> 
 <point x=NatStr y=NatStr /> 
 <point x="30" y="40" /> 
 <point x="1" y="199" /> 
where NatStr is a natural number written down as a string, e.g., "0", "1", "2", etc. I am intentionally specifying the XML format in an informal manner so that you can choose your favorite specification language -- if you even wish to use one. (I did not.) We will discuss XML in lectures.

Deliverables: Your SVN directory must contain a sub-directory named "1" with all source code plus two (three) shell scripts that run on Linux Ubuntu (available in the public labs of West Village H):

  1. xlog compiles (if necessary), links (if necessary), and runs the STDOUT LOGGING application.
  2. xclient compiles (if necessary), links (if necessary), and runs the TCP application that connects to our server.
  3. xserver [optional] compiles (if necessary), links (if necessary), and runs your own version of the "reverse echo" server. This is entirely optional and we do not promise to run/inspect/grade this server.

Note: It took me between two and three hours to design and implement my Racket solution. The solution consists of around 250 lines of code, split into five modules. Assuming you know some but not all of your chosen language's libraries, I conjecture that it will take you between five and 15 hours to create your solution. If it takes you longer than 20 hours, please see me before the homework is due.

last updated on Tue Apr 12 15:14:46 EDT 2011generated with Racket