(JAVA) We will write a program to check the spelling of the word entered by user, using...

60.1K

Verified Solution

Question

Programming

(JAVA)

We will write a program to check the spelling of the wordentered by user, using data from a dictionary, which is text file.The program will ask user to enter a word for spell check, and thencheck in the text file (dictionary.txt) if the word exists. (Thedictionary.txt file is provided) If the word exists in text file,the output will be “Word is correctly spelled”. If the word doesn’texist in the text file, program will write the message “Worddoesn’t exist in the Dictionary” and will request user to enter“yes” or “no” to save the word in another text file. If user wantsto write the word in a text file, user will enter “yes” (This textfile can be named anything, for example “PersonalDictionary.txt”).Note: at this step, you need to write the word in the text file anddisplay the message “****** is saved successfully in the file”(Asterisks denote the word entered by the user). If user doesn’twant to write/save the word in the file, user will enter “no” andthe program will display a message “****** is not stored in thefile” (Where asterisks denote the word). After this, program willask the user to enter another word or enter some key (for example:-1) to exit the program. The program will use “dictionary.txt” fileto read the list of words to be compared with. The program willcreate and write into a file (you can name it anything, for example“updateDictionary.txt”), the list of words that don’t match.

1. (60 points) Program runs successfully

a. (10 points) Inputs word from the user using a Scannerobject.

b. (10 points) Reads the dictionary text file and save the datain a variable

c. (10 points) Repeats until user exit the program (UsingSentinel value to stop)

d. (15 points) Writes the word into a new personal dictionaryfile

e. (15 points) Outputs the final summary correctly for spellingcheck

2. (40 points) Program contents follow readability standardsincluding:

a. (10 points) Correct use of arrayLists or any other datatype

b. (10 points) Successfully write and use a method outside ofthe main method

c. (10 points) Correct variable types with Useful, Camel-caseidentifiers and proper tabbing.

d. (10 points) Document your code with at least 5 helpfulcomments

i. Put comments above the lines of code they are documenting,not to the right

I cannot attach the dictionary.txt file i appologize

Answer & Explanation Solved by verified expert
3.9 Ratings (725 Votes)
import javaioFileimport javaioFileNotFoundExceptionimport javaioFileWriterimport javaioIOExceptionimport javautilArrayListimport javautilScannerpublic class DictionaryCheck public static void mainString args String filename dictionarytxt String personalFile personalDictionarytxt Dictionary dictionary new Dictionaryfilename PersonalDictionary personalDictionary new PersonalDictionarypersonalFile Scanner sc new ScannerSystemin while true SystemoutprintlnEnter Word to check Word    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students