CMPT 166 (DS) Fall 2009 Lab Assignments

Lab 0: HelloWorld (due Mon 21 Sep) (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).

Lab 1: Selection (due Thu 24 Sep) (20pts)

Write a Java program that uses the if or switch structures to print the song, "The Twelve Days of Christmas". The user must be asked to enter a day from 1 to 12, and the program must display the corresponding message for that day. The strings for each day should only appear in your code once each (e.g., the string "five golden rings" should only appear in your code once). Google for the lyrics, or make up your own (keep it clean, please).

Lab 2: Flow of Control (due Thu 1 Oct) (20pts)

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

Lab 3: Classes (due Thu 8 Oct) (40pts)

ch5 (p.328): #4 (use arrays), or #6 (parts one and two), or #7 (parts one and two).

Lab 4: Swing I (due Thu 22 Oct) (40pts)

ch17 (p.999): #1, or #2, or #3. Feel free to use whatever layout managers you like, but make it reasonably easy-to-use and not unbearably ugly.

Lab 5: Swing II (due Thu 12 Nov) (40pts)

Both of these options require a nice user-friendly Swing GUI: your program should be reasonably easy-to-use and not unbearably ugly. An average computer user (non-programmer) should be able to figure out the controls, even without the help text (which you should also provide).

Lab 6: TCP Client-server (due Thu 3 Dec) (40+10pts)

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