Lab Exercise #2
for lab meeting Wednesday, Sept. 10, 2003
Objectives: As we know, Java is very fussy about your directory
structure: the compiler expects certain packages and classes to be in
certain (sub-)directories and gives compilation errores if it can't
find what it needs in the expected places. The purpose of this lab is
to give you some experience with Java directory structures and to help
you familiarize yourself with the directory structures we'll use in
this course.
Once you completed lab 1, you were left with this directory structure:
your top-level directory
csci53
programs53
(a shortcut to Feldman's directory of programs from the Lewis &
Loftus book)
csci133
cs1
(currently contains the Keyboard
class) mbf (Feldman's classes,
currently contains the Screen
class) programs133 (a shortcut to
Feldman's directory of files from the Lewis & Chase book)
jss2
(a subdirectory of reusable classes from Lewis & Chase)
exceptions
(an inner directory of exception class files)
Assignment:
Part 1: Setting up the directories.
Create another subdirectory of your own, csci133/jss2, which will
contain any reusable classes you copy from Feldman's programs133/jss2 directory, and
yet another, programs133/jss2/exceptions,
to contain any exceptions you copy.
Copy the application program Bingo.java, from programs133 into your own csci133 directory.
Examine this file; to compile it, you'll have to copy what it
imports. Notice that it imports jss2.ArrayBag.
So copyArrayBag.java from programs133/jss2 to your csci133/jss2.
Now examine ArrayBag.java;
note that it implements the interface BagAdt, and imports from jss2. Copy the necessary files.
(It also imports from the standard API's; you always have access to
these without copying them.)
Now compile each of the files you've copied, startiing from the
lowest directory and moving back to Bingo.java.
Run Bingo.
Part 2: Start on Project 2.
The best way to begin this project is to examine the BagADT and ArrayBag source code and make
sure you understand it as well as possible before leaving the lab. Ask
the lab instructor for help if necessary. Use Chapter 2 to help you
as well. (end of lab)