Question
Write a JAVA program (WITH COMMENTS ADDED IN THE CODE PLEASE TO HELP UNDERSTAND) that prompts for a file to check the spelling of all
Write a JAVA program (WITH COMMENTS ADDED IN THE CODE PLEASE TO HELP UNDERSTAND) that prompts for a file to check the spelling of all words in a file. It should read each word of a file and check whether it is contained in this word list (attached words.txt). ... The program should print out all words that it cannot find in the word list.
Note: Use of CaPiTaLIzed letters should not cause a spelling error. Use of punctuation! "should not" cause a spelling error. Making nouns plural may cause a spelling issue. Having past tense of variables may cause a spelling issue. Examples: "cat" is spelled correctly, "cats" is not. "bike" is spelled correctly, "biked" is not.
- by "spelled correctly", it is saying that the word (ex. biked) is in the sample.txt, but not found in the words.txt file.
- Develop and test an algorithm ahead of time. You goal should be to read the file(s) as few time an needed. (i.e. you should not read a file more than once. Reading/Writing to files is 'tedious' for a program to do. When you read in a file, store the data in your program.)
- Words that show up in the output may be spelled correctly, but are simply not in the attached word file.
words.txt sample.txt A a aa aal aalii aam Aani aardvark aardwolf Aaron Aaronic Aaronical Aaronite Aaronitic Aaru Ab aba Ababdeh Ababua abac abaca abacate abacay abacinate abacination abaciscus abacist abark When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation. We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.--That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, --That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.--Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history
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