CMPT 166 Spring 2010 Lab Assignments

Lab 0: HelloWorld (due Wed 20 Jan) (0pts)

Write a simple Java program that prints "Hello, World!" on the command-line. No write-up is needed for this orientation lab; the main point is to make sure you are setup with a Java development environment (editing, compiling, running). You may find Eclipse intro useful, or you can use this time to get your own Java development environment installed and working. But you need to be ready to code for your Lab1!

Lab 1: Flow of Control (due Mon 25 Jan) (40pts)

Java text (Savitch), p.162-164: choose one of #2, #5, or #8. (#8: also generate or come up with your own cryparithmetic puzzle)

Lab 2: Classes (due Wed 3 Feb) (40pts)

Java text (Savitch), p.247-248: choose one of #2 (Fraction), #3 (Odometer), #4 (BlogEntry), or #6 (StudentGrades).

Lab 3: Inheritance (due Wed 17 Feb) (40pts)

Java text (Savitch), p.469-472: choose one of #3 (Alien), #6 (Truck), #7 (Patient), or p.509 #4 (predator-prey). The last option (p.509 #4) is worth up to 5 pts extra credit (45 total) if done correctly and completely.

Lab 4: Swing (due Wed 10 Mar) (40pts)

Develop your own GUI program using Java Swing! Here are the requirements: Suggestions for possible lab ideas:

Lab 5: UML (due Wed 24 Mar) (40pts)

Design a small project of your choosing, using UML diagrams to illustrate. Your project need not be too complex, but it should be a cohesive system with a clearly-defined purpose, and you should design sufficient functionality so that the system is useful. Your project need not be computer-related -- classes may represent non-software objects, e.g., Animal class, Truck class, etc.


This lab is not a programming lab (no code required), so instead of the usual lab write-up, you will hand in a complete design document with the following sections:
  1. Name of the system
  2. Short description of its purpose ("30-second summary")
  3. Target audience / end-users: who would find your program useful?
  4. Use-case diagram:
  5. Detailed descriptions of each use case in the diagram:
  6. Component diagram: draw a CRC diagram or something similar.
  7. Sequence diagram:
  8. Class diagram:
You may format your design document as a single Word document with tables/figures, or you may include the UML diagrams as separate files and refer to them in the document. Please ensure the document is neat and well-organized, written in clear English, easy for someone well-versed in UML to understand.

UML References

You may find the following links helpful for further reading on UML:

Diagramming Tools

Feel free to investigate and use software UML tools such as Eclipse UML2Tools, IBM Rational Modeler, or drawing/diagramming tools such as Dia, Adobe Illustrator (installed on campus computers), or even Paint.

Some of these can be quite complex to learn (I think Dia is the simplest), so if you like, you may draw your diagrams (carefully!) by hand and scan them in. The diagrams must be very neat and easy to read, though! The design work is complex enough as it is; I suggest that you not spend too much time learning a complex software UML tool to diagram it.

Choosing a Project

I suggest that you choose a small, easy-to-define system as your project, as the design document can be very large even for small projects. At a minimum, have at least 3 actors, 3 use cases, 1-2 alternate flows for each use case, 3 components, separate sequence diagrams for each of 3 use cases, with 3-4 messages in each sequence diagram, and 4-5 classes, with relationships. These are guidelines, but don't let them constrain you -- the point is to have a reasonably complete design of a small system.

Some possible ideas:

You may feel free to expand on your Lab4 or future Lab6 idea, too!

Lab 6: Android or TCP/IP (due Fri 16 Apr, with in-class presentations Wed 14 Apr) (40+10pts)


Write a cool Android application! You may demonstrate it on the software emulator. When you're ready, you may try it out on my phone (but it's okay if it only works on the emulator).

We might not have time in-class to get very far on Android, but there are many resources to help you learn Android on the Android developer site:

TCP/IP Client-Server

Come up with your own cool client-server network application (e.g., chat/IM, stock-ticker, sending pictures, web server)!