Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in C++ and briefly explain. Question 1 Write a ReadCorrectWords function to store all known, correct words for your spellchecker. It should have
Please write in C++ and briefly explain.
Question 1 Write a ReadCorrectWords function to store all known, correct words for your spellchecker. It should have the following parameters in the order provided a string filename an array of strings correctWords[] the size of the array an integer startlndex. Your function should return the total number of correct words in the array correctWords. Your function should open the file identified by filename and read lines from the file line by line. The file will have the following format: correctWords.txt chicken fish COW bubbles pear kiwi You can expect exactly one word on each line. Each word is a correct spelling and should be added to the correctWords array. The parameter startlndex is the index at which you should begin adding your words in the array. If I called your function with the file above and startlndex- 0, your correctWords array should look like this: ["chicken", "fish" "cow", "bubbles", "pear", "kiwi"] Your function should return 6 (for 6 words total in the array)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