Lab 8

Code for this lab

For this lab you need to create a class called SpellChecker

You will first create a HashSet of Strings. This will be initialized in the constructor

The first method you will make is called buildDictionary. It will take a parameter of a Scanner and use its input to populate the dictionary. You will use the HashSet add method to add the Strings to the dictionary and get them from the scanner using next (make sure you check if it hasNext first)

The last method you need to make is called checkSpelling. It also takes a Scanner as a parameter. You will take each word from this scanner (again, using next) and strip off the useless parts. These parts would be extra spaces, periods, and commas. After that you will use the HashSet contains method to see if it is in the HashSet. Format what is print in each case (whether it is or isn't in the dictionary) based on what is in the sample log files.

Zip up the folder and submit to dropbox!