Lab 12


Using the Konqueror browser, go to the course web-page: and click on the link and "Save to disk" in the cs2 subdirectory created in lab 1. In a shell window, change to the cs2 subdirectory. Use the "ls" command to list the files in the directory and look for the file "". Decompress the "" using the command "unzip", then change to the Lab12 subdirectory.

Part A: Converting an application to an Applet Change to the partA subdirectory. Compile and run Your task in part A is to convert the pinball game to run as an applet rather than as an application. Write a simple HTML page to view your applet that's similar to what I did with the Cannon World Use the subdirectory "web" off your home directory to store you codebase. See the notes at

Part B: Java Network Programming Change to the partB subdirectory. In an editor open the file that contains a representation for some amount of pocket change in either British or American coins. Also open the file which contains a partial server program to convert PocketChange either from British coins to American, or the reverse. For Part B of the lab, you are to complete the following tasks:

  1. Complete the ChangeMaker server so it can convert American to British coins.

  2. Write a client program that will interface with this server. Allow the user the ability to specify input as either American or British currency.

  3. After testing your client and server by running both on your machine ("InetAddress.getLocalHost()" in the constructor to the Socket in the client), run the server on your neighbor's computer and have the client connect to it from your computer. To do this:

    a) In a shell on your machine, open up a secure shell to your neighbors machine by: ssh where the ## are replaced by the machine number on the back of your neighbor's computer

    b) In the secure shell window, change to the directory where your server code resides and start running.

    c) In a shell window on your machine, run your client with the modification of ("InetAddress.getByName("")" in the constructor to the Socket in the client).

Near the end of the lab, raise your hand and demo your best attempt to complete Lab 12 to the TA (Patrick) or instructor.

Extra Credit: 3) Modify the ChangeMaker server to service each client in a separate thread (similar to the Therapist server).