CM10135 / Programming II:   Assignment 2 (2004)

Build Your Own Chat Application

Assignment Date:  Tuesday,  9 March.  Due date:  Thursday, 25 March at 4:00pm

This assignment is the second of four you will have in this course.  Your mark in Programming II is composed of 60% coursework, 40% exam.

The Basic Idea:

In this assignment you will be creating a GUI application that allows people to chat with each other.  This project should let you develop and display your skills in GUIs, threads, networking and handling exceptions.  Of course, you won't know anything about networking in the first week of the project, but you will have plenty to do that week building the basic interface. 

Note:  Networking lectures start the week of 15 March, so you should just be working on the GUI and threading the first week!

Reminder on plagiarism:  Plagiarism occurs any time that you use someone else's ideas without acknowledging them.  Plagiarism is much, much worse than asking for help.  If you get help on any part of your assignment you should acknowledge this in the comments.  This includes asking coursemates, tutors, or other staff, as well as reading things in books or on the Internet.  Say exactly where your help came from, and exactly how much of the code is your own.

What to do:

  1. Remember to write an informal specification / requirements statement of your application before you start.  You will probably want to draw the window(s) you want to build, and specify some classes.
  2. First, you want to build a GUI application with some labels, two large text panes and at least one button.
    1. One text pane is for typing into / sending messages, the other is for receiving messages.
    2. The labels should make it clear which is which.
    3. One button should let you quit the application.  You might want to add other buttons too (see below.)
  3. Next, you want to implement the producer / consumer pattern (see the Sun tutorial) for the two text panes.  When you enter text in one pane, you want it to be printed in the other.
    1. You can do this in real-time, or after you hit return, or after you push a button, your choice.
    2. Make certain that your labels make it obvious how to use your GUI!
  4. That's all you have to do for a minimal pass (see criteria below.)
  5. This next section won't make much sense until you've had your networking lectures.
  6. Add radio buttons to chose whether you are running a `client' or a `server', and two little text boxes for your IP address & a port number.
  7. Make your application work across a network, e.g. use it to have a chat between two BUCS computers.
  8. Be sure to do good exception handling, e.g. so you can tell if the client couldn't find the server.
  9. Getting a chat working across the network is all the functionality you need for a good pass.
  10. Add optional / creative features (see suggestions below) to get marks towards distinction.
Remember: functionality alone doesn't get you high marks!  There should be good code layout, good comments, good documentation, and good exception handling.

What to hand in:

  1. Your specification / requirements statement.
  2. A design for your solution, including especially the algorithms.  Note that we expect this to have been written before you have done the coding, so it may have bugs in it!
  3. A printout of your fully-commented code.  Poor program layout will lose marks.
  4. A short write-up of your experience getting your application to work.
    1. Include a screenshot of your GUI.
    2. Be sure to include instructions for how we can run your application, since will also be running your program to check on it.
  5. A conclusion that contains a critique of your program:  What did you do right?  What did you do wrong?  What would you do differently if you did it over?
  6. A disk containing an uncompiled version of your code.  Be certain the disk is not write protected!  The person marking your program will be compiling & running your program.
Remember: marks are not given just because a program compiles or runs!  It should run robustly, and it should be well commented & well documented as specified above.

How you will be marked:

The marks allocation for this assignment is as follows:
  1. Requirements statement 10% 
  2. Design of program solution 15% 
  3. Fully commented, working programs implementing your design 45% 
  4. Results and analysis 10 % 
  5. Conclusion/Critique 20 % 
Total 100%

Threshold Pass for each component
  1. Brief discussion of requirements. 
  2. Brief program design. Brief details of how the design will be implemented in Java. 
  3. Simple program. Basic level of commenting. Code layout is mostly correct. Minimal exception handling necessary for a compile.
  4. Minimal functionality: 
  5. Conclusion gives a brief, not very thoughtful discussion of the resulting solution. Little useful criticism and few ideas for improvement. 
Good Pass for each component
  1. Good requirements statement. 
  2. Good program design starting with a high level design and showing refinement into appropriate levels. Algorithms are given at an appropriate level of detail and are well explained. Clear description of how design will be implemented. 
  3. Program is a good implementation of design. Layout of code is correct and clear.  Some reasonable exception handling, e.g. reasonable messages or steps taken on likely exceptions.
  4. Basic functionality: 
  5. Conclusion shows a thoughtful discussion of the program and the development process you undertook and good analysis of the results. Sensible criticism of your work, and good ideas for improvement. 
Distinction Pass for each component
  1. Requirements statement covers all aspects of problem. 
  2. Detailed program design starting with a high level design and showing refinement into appropriate levels. Algorithms are given at an appropriate level of detail and are well explained. Excellent description of how design will be implemented. 
  3. A sophisticated program showing good use of Java, but not overly complex. Commenting is appropriate and gives sufficient information. Layout of code is correct and clear. Fully appropriate use of exception handling.
  4. Exceptional functionality: 
  5. Conclusion shows a thoughtful discussion of the program and the development process you undertook and excellent analysis of the results. Detailed and thoughtful criticism of your work, and well-thought-out ideas for improvement.

page author: Joanna Bryson
set 25 February 2004
, most recent update 8 March 2004