This website is preserved for historical and scholarly reference and is no longer actively maintained.
Assignment #4
Due Tuesday, March 9 at midnight.
This individual programming assignment will be accepted up to two class days after the program was due. There will be penalty points deducted as follows.
turned in by midnight Tuesday, March 9: no points deducted
turned in by midnight Thursday, March 11: 20 points (total) deducted
turned in by midnight Friday, March 12: 40 points (total) deducted
not accepted after midnight Friday, March 12
Problem 5.18 on page 207 of Weiss requests that you design a spelling checker and you have submitted a design for a spelling checker as a homework assignment.
Create a file, SpellCheck.h, that contains the interface for the spelling checker.
Also create a file SpellCheck.cpp. The next-to-last line in SpellCheck.h, ie.e., the line immediately preceeding the #endif, should be #include "SpellCheck.cpp".
Most of the methods in SpellCheck.cpp should be implemented as stubs.
That is, each method may have a cout stating that the method was called and giving the values of any simple parameters such as strings, ints, or floats.
If a value is to be returned, the value is chosen arbitrarily, in order that the code will compile without error.
The constructor should be implemented.
Other code should be included only as it is necessary to show how private methods are called.
This is top-down design. The lowest level methods are not to be implemented at all, but must be present to test the interface.
Every method must have precondition (if required), postcondition, and pseudocode algorithm clearly stated as comments.
Using the handin command, turn in SpellCheck.h and SpellCheck.cpp. Programs that do not compile will receive very little credit.
It is expected that the constructor in SpellCheck will initialize a HashTable usi9ng a dictionary that you send to it.
Use the dictionary in /usr/share/lib/dict/words. Then, the command
MyCheck.checkspelling ( fileName );
will use the object of type SpellCheck named MyCheck to check spelling of all words in a file named "fileName".
Use the required style standards .