CSCI 220
HOMEWORK ASSIGNMENT #5
Assigned Date: Thursday, April 1, 2004
Due Date: Monday, April 12, 2004
Due Time: Noon

 

Updated: Thursday, April 08, 2004

Source filename to be submitted: ModularWordStatistics.java

Skills Developed: Modularization and methods.

Documentation and submission: See instructions in the first homework assignment.

Assignment:

Your assignment is to modularize the previous program, WordStatistics.java.

You should have the following non-static methods (use the exact names specified):

Your methods (and program) should be documented as per the departmental documentation standards. Include Purpose, Precondition, and Postcondition documentation for each method. For the Purpose documentation do not simply cut and paste the above rewrite them appropriately. Document the information flow for each parameter (/* in */, /* out */, or /* in|out */). If a method uses local variables, declare them at the top of its body, and fully document them.

 

Here is a draft of the solution, in case you had some difficulties with the previous assignment.

 

Notes:

  1. Test your program with different inputs to ensure that it works properly.
  2. Once you are satisfied that your program works, run your program against the files
    Shakespeare-King-Lear.txt
    Shakespeare-Macbeth.txt
    Shakespeare-Othello.txt
    Shakespeare-Romeo-and-Juliet.txt

    Then run your program against the files
    Mark-Twain-A-Tramp-Abroad.txt
    Mark-Twain-The-Tragedy-of-Puddnhead-Wilson.txt
    Mark-Twain-Tom-Sawyer-Abroad.txt
    Mark-Twain-Tom-Sawyer-Detective.txt

Compare the output with the output from the previous program.