For this assignment you will write two separate Java programs. One will be a textual output oriented room reservation processor. The other will be a generalization of the clock animation applet from the book.
Undergraduate students may work in teams of 2 for this homework. Use AFS to give both of you permission to access a homework directory before you start work. Do not share passwords. Make sure to indicate in comments on the files that both of you are authors. Groups larger than two, or which include graduate students are not permitted. If you have problems getting group permissions to work, see me.
You are provided with a driver for a room reservation system that uses the following classes in a package schedule:
equalsdefined and should be Comparable.
equalsoverriding) with a name.
You need to provide a good design for these classes (this homework will not list required methods and fields), but in order to provide some constraints, you are provided with a driver. Your classes must work correctly with the provided driver. We will also provide the expected output on one test file. During grading, there will be other test cases as well.
You should put all the Java files (except the driver) in a package
schedule'' in a project (or directory) named
homework2 directory of your AFS volume.
You may use any of the classes in
Float (the latter two classes
are used only for their
In addition, your code will need to use
java.io package. You should not use any classes
java.util, such as
If you use an IDE such as Eclipse, we suggest you begin with the driver and work ``down,'' because the IDE will suggest stubs for functions as you use them in your code. (In Eclipse, the suggestions show up as combination light-bulb/stop-sign markers in the margin.)
Please use Java conventions for method names and fields: use
mixedCase rather than
under_scores to separate words,
If you wish, you may start field names with an underscore
(and then please be consistent).
The textbook defines a digital clock animation applet.
Please extend it with inheritance in a new class
DateClock. It should accept an applet parameter
that should be a valid
java.util.TimeZone ID (see the JavaDoc).
It should display a digital clock, together with the date in the
DateFormat. The date should appear below the
time in the applet.
Make sure your applet works correctly when the day changes!
Please put your room reservation files in a subdirectory
(this can be an Eclipse project), with the ADT files in
Part1/schedule. The driver that we provide is available under
The same directory will also hold sample input and output.
The code from Chapter 4 (and in particular the
class is available in
Please import the necessary files into a subdirectory (or Eclipse project) called
Part2. Your internationalized clock/date applet should be called
DateClock.java. Please have an
htmlfile which loads your applet to show the date and time in Japan (but not in Japanese!).
Both projects must be runnable from within their respective directories. In other words, on a grid, it must be possible to
grid.cs: cd homework2 grid.cs: cd Part1 grid.cs: cs bin (optionally) grid.cs: java Driver ... grid.cs: cd ../Part2 grid.cs: appletviewer DateClock.html
As usual, all work must be completed by 12:30pm, Tuesday, October 2nd, 2007.