CSE 373 Spring 2005

Homework #1

Spell Checker (I)

March 31, 2005

Due:

electronically Thursday, April 7, 8:00 pm; paperwork at beginning of class Friday.  (What is "paperwork"?  This will differ from assignment to assignment.  It means anything which is supposed to be handed in on paper rather than electronically.  Read the instructions to identify such items).

Objectives

Description

Remember our discussion of designing a word processor?  In this exercise you will implement code to display and spell-check a document.  Only a very simple version will be needed now; a later assignment will make things more interesting.  In addition to the basic functional code, you will have to write certain test and driver code, as well as preparing a short report on your results.


Most of the specification details can be gleaned by studying the code and comments in the starter code provided.  In particular, there is an interface called ISpellChecker.  You must write a Java class class SpellChecker which implements this interface (in the technical sense, using the implements keyword).   There is also an IDocument interface.  You must implement this in a class called MyDocument.  You will find other required code mentioned in the files and elsewhere in this write-up.  

Pay special attention to the comments in the starter code.  It has much important information which is not duplicated elsewhere.

You must use the exact names for classes and methods as specified here and in those files.   You cannot declare a constructor except the one mentioned in the interface comments.  You cannot create additional .java files.   You may not modify any interfaces in this other assignments (you can't turn in modified versions).  None of your methods should require any user input of any kind, or any input file (this will change in later versions of the program).

You can have additional helper methods as needed; ordinarily these should be private.  You can define additional classes but only if they are internal to the specified .java files.

Note that the code files are in packages.  You must preserve this package structure.  Sometimes IDEs (like Eclipse or DrJava) will helpfully strip out or modify the package statements.  Don't let this happen!  If you don't have the right package structure, your .java files won't compile when you try to turn them in.

Do not use any graphics for this project.

For this and any other assignment in CSE373, you are free to use any standard Java library class, and to use any method of those classes (unless there is some explicit instruction to the contrary).  You should not use any library, class, or code aside from this (for example, something you found on the Internet or written by someone outside the class).

For this particular assignment, each student should work alone.  In some future projects we may pair you up to work together.

You may have used JUnit in the past.  Although this assignment involves writing a test method, you won't use JUnit for it (we will in a later assignment).  Instead, expand and improve the classes TestSpeller and TestDocument.  In particular, make the main method of TestSpeller as complete and thorough test of the Speller as possible.  It should be able to detect if there is any error in any implementation of ISpellChecker, not just yours.  TestDocument should also be expanded, but it won't be weighted as much in the grading.

Turn in:

Electronically: two .java files: .  Details of how the electronic turn-in works will be available later.
On paper: printouts of the two .java files.  Plus: a short report which

Grading

Most of the grading points will come from

Good luck and have fun!


Notes
If you have questions along the way, either about the assignment or how to do things, feel free to discuss it on the Message Board.  Just don't give away code, or any crucial aspects of the solution.

Where applicable, write your code to be reusable and modifiable.  In a later homework, you might in fact have an opportunity to reuse or modify code from this one...