Question
Write a program named SpellCheck that reads a file named paper line by line, keeping count of the line numbers as it does. With each
Write a program named SpellCheck that reads a file named paper line by line, keeping count of the line numbers as it does. With each line, the program examines every word in the line (hint: use a Scanner based on the String holding the line). For each word in the line, the program looks up the word in a file named Dictionary. If the word is to be found in the Dictionary file, then the word is spelled correctly and no action is taken. Otherwise, the program displays the line number and the word to standard output (thus indicating the spelling error and where it occurred). The format of the output line is this: first "Line " literally. Then the line number displayed in a field of FOUR positions. Then, a colon and a space... and finally the misspelled word itself. For example:
Line 47: neccesary
Note: in this program, every lookup of a word must involve opening the Dictionary file, searching it, and then (reminder!) closing it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started