CSE 373 Winter 2005

Homework #1

Anagram Tester

January 6, 2005

Due:

electronically Thursday, Jan. 13, 8:00 pm; paperwork at beginning of class Friday.

Objectives

Description

Remember the World Capitals puzzle from NPR?  In this homework you will design and implement solutions to two related problems.  Specifically, you will write
In addition, you need to write a test method for one of these, and a short main method (given).

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 IAnagramChecker.  You must write a Java class class AnagramChecker which implements this interface (in the technical sense, using the implements keyword).  Also complete the class called AnagramTester. 

You must use the exact names for classes and methods as specified in those files.   You cannot declare a constructor unless it takes zero arguments.  You cannot create additional .java files.   You may not modify IAnagramChecker (you can't turn it in).  None of your methods should require any user input of any kind.

You can have additional helper methods as needed.  You can define additional classes but only if they are internal to the specified .java files.

The test method testIsAnagram that you are asked to write deserves a little more discussion.  This method should be able to determine whether any implementation of isAnagram is correct.  In other words, it's not good enough if testIsAnagram seems to work OK given your version of isAnagram.  If I gave you a completely different implementation of isAnagram, your testIsAnagram should be able to determine whether or not that version is correct.

Note that AnagramTester is not a JUnit class.  We will use JUnit in the course, but not just yet.

You are not required to turn in any test method for findAnagrams.  Nevertheless, writing such a method can only help you!

Turn in:

Electronically: two .java files: AnagramChecker.java and AnagramTester.java.  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...