University of Washington, Bothell
CSS AP442: Advanced Programming Methodology I
Homework Assignment 3: Graphical User Interfaces
Assigned: 17 November 1998
Due: 30 November 1998 by 8AM
This assignment extends assignment 2 by adding a simple graphical user interface (GUI). You will implement this GUI as a Java Applet, and make it and the source code available on your own web site for grading. This will also be the first time that you will be expected to learn a feature of Java without any prior in-class coaching.
You will want to present a simple GUI for allowing the user to control the race and displaying its state. At minimum, the user should be able to start the race and reset your program for starting a new race after a race is over. While the race is occurring, you should show each cyclist's position graphically. Your race display could use a modified Scrollbar or something fancier (maybe with little people), perhaps drawing on a Canvas. You should also indicate the winner graphically, when the race is over.
Modify your program for assignment 2 to be an applet with a graphical user interface. Your GUI should, at the minimum, have two user controls: one which starts the race, and one which resets the race when it is complete. These controls should only work when appropriate; i.e., using them at other times should have not effect (or, preferably, they should be rendered insensitive at those times). Your GUI should include an area which graphically displays the race progress (don't just use two lines of text or two Labels). Your final applet should continue to satisfy all of the requirements for assignment 2, except those relating to the GUI.
Implement your GUI so that your applet can handle more than 2 cyclists. You will need to add GUI elements so the user can select the number of cyclists. You may limit the number of choices, for example, 2-9 cyclists. Remember that the area devoted to an applet is specified in an external HTML file, so you will need to allocate enough screen real estate to display the maximum number of cyclists. As in assignment 2, the probability tables for the additional cyclists should be generated randomly, such that the weighted sum for each (sum of probabilities times corresponding moves) is between 0.2 and 0.8 (average number of segments per time step).
You will submit your work on your own web page, either here at UW or elsewhere (if elsewhere, please ensure that the web server will allow you to use applets). Your submission will include an HTML file and all .class files in one directory, and all .java files in another. We will check the time stamps on your source files, so make sure they're in place and don't modify them after the due date/time. See the course web page for an example of how to do this.
Please email the URL of your HTML file to firstname.lastname@example.org, with your name and ID in the subject line. You will receive one automated response, which you should save as a receipt of submission. Please send your URL only once; multiple submissions will slow our turn-around time to everyone.
This document was generated using the LaTeX2HTML translator Version 98.1p1 release (March 2nd, 1998)
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -split 0 assn3.
The translation was initiated by Dr. Michael Stiber on 1998-11-17