Assignment 9: Abstracting Traversals; Using Exceptions; Introducing Collections

Text as pdf

Text as html

Source code for part 1 of the assignment Hw9part1.zip

Source code for part 3 of the assignment eliza.zip


I extended the simple test harness so it also compares the expected and actual values of the IRange type. It assumes that the elements of the structure referenced by the iterator implement the ISame interface. You can download it from here and use it to run some of the tests.

SimpleTestHarness.java


The following file needs to be unzipped and loaded (whole folder) into the eclipse plugins directory. You then need to add a Variable to your eclipse project, for all three parts of your homework, same way as you did with the draw teachpack for the World. More detailed instruction that should work with the Windows login are here and have been posted on the newsgroup.

jpt.jar zipped in edu.neu.ccs folder jpt.zip


Here are several text files of data for various cities. The last one is quite large and you do not need it for this assignment.

minicities.txt

smallcities.txt

tencities.txt

citydb.txt


Addendum 1: We decided to drop the Problem 9.6 from assignment 9. However, if you already put the effort into it, save it, as it will appear on assignment 10.

Addendum 2: The selection sort in the Problem 9.7 is best done when the data to be sorted as well as the data it produces is stored in an ArrayList. You should not need to use the iterators for that problem. To get to a particular item in the ArrayList all you need to know is its index. The while statement, instead of proceeding to the next iterator, proceeds to the next index (one larger than the current one).

Due Date: Monday, March 21, 2005 at 6:00 pm.