Homework 4 Clarifications
- Error Checking - The assignment says that for your MazeBuilder
program you should do error checking similar to what was done in
Reverse for HW1. This means you should *look* at Reverse and see what
it does - you can even borrow code from it. But if you want an exact
list of things to check for here you go: a) Check that the correct
number of parameters have been passed and if not, print a message to
the user indicating the correct way to use the program and exit. b)
If the file name given could not be opened or written to, print the user
a message and exit. c) Check that two integer values have been passed
for the maze dimensions - you can do this using parseInt and checking
for NumberFormatException as is done in Reverse. You should also
check that a dimension of zero has not been passed in. In either case
you should print an informative message to the user and exit.
We won't require that a specific exception be raised for any of
these cases, but the code for Reverse should serve as a good starting
point for you. We will expect your code to recognize the situations
listed above, print out an informative message and exit.
- For Part I., your MyDisjSets.java you should NOT be using things
from the java collections. This includes NOT using Arrays.copyOf or
toString (you need to write out the code for printElements yourself).
It is fine to use the length field of an array.
- For Part II., your maze generation
program, it is o.k. to use things from java collections.