cp -r ~mc28/labs/java/java .(Note that this command ends with a space and then a period. Ask for help with this if you need it.) You will get a new directory called
java
. This directory contains three subdirectories, one
for each portion of the lab. All the individual java files you will
use are in one of those subdirectories.
ItemList.java
the class that
holds the Items the customer is ordering
Item.java
the base class for
different kinds of clothing items, specifically
CompuDuds.java
this is the main program class; it has no instances but has a number
of important "static" methods (i.e., methods that are class-wide, not
associated with any specific instance).
The first thing to do is to test the program out without yet having
made any changes. That way you have a baseline for comparison: if it
isn't working, you aren't the one who broke it. To run the program,
compile the source files and run the CompuDuds
class by typing:
javac *.java java CompuDuds
Now you can start making the necessary changes, and test and debug
as you go along. Do exercises 15.2 through 15.4 on pages 598-599
as well as exercise 15.20 on pages 640-641 of the text. For exercise
15.3, you will need to make a new class that is very similar to one of
the existing classes. Use the cp
command to copy the
existing .java file to a new file, and use emacs to edit the
new file as appropriate.
For exercises 15.2, 15.4, and 15.20, you should simply modify the class ItemList. Furthermore, when submitting this part of the project, just submit the final form of the CompuDuds directory, which contains all the changes for the four exercises together.
sleep
commands and the synchronize
keywords
in your code. (The synchronize
should get rid of the
problems exposed by the calls to sleep
.)
Your solution to 15.14 should be precise. Mathematical assertions, such as invariant (1), are best confirmed with clear notation and equations (and only a little text).
For exercise 15.16, be sure to clearly explain where you put your calls to sleep to make each behavior happen.
The gradesheet for the project is available in PostScript or PDF format. (If you print a copy out, you can staple it to the front of your project report to save paper.)
CompuDuds
portion, you should write a main
method in ItemList
which does the testing.
emacs
if you wish.
cd
to the directory containing the
java directory that contains the four portions (subdirecotories) of
the lab, and type ls
to make sure you are in the right
place. Finally, type:
~wolfe/public/178/submit java