CMPT 166 Spring 2008 Lab Assignments

Lab 0: HelloWorld (due Wed 16 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).

Lab 1: Selection (due Wed 23 Jan) (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 Wed 30 Jan) (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 Wed 6 Feb) (40pts)

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

Lab 4: Swing I (due Wed 20 Feb) (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 Wed 19 Mar) (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 Wed 9 Apr) (40+10pts)

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