Question: Here are my code for check word: string CheckWord(string word,string correctWords[],int correctWordSize,string misspelledWords[][2],int misWordRow){ int index=0; while (word[index]!='0'){ char c=word[index]; c = tolower(c); word[index] =
Here are my code for check word:
string CheckWord(string word,string correctWords[],int correctWordSize,string misspelledWords[][2],int misWordRow){
int index=0;
while (word[index]!='\0'){ char c=word[index]; c = tolower(c); word[index] = c; index++; }
for(int i=0;i
![Here are my code for check word: string CheckWord(string word,string correctWords[],int correctWordSize,string](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66ef7a7f17a47_49466ef7a7e8b6d0.jpg)
Write a function CheckPhrase to check spelling in a phrase. It should have the following parameters: a string phrase, a string outputFile e an array of strings correctWords Size of the array correctWords a 2D aray of strings misspelledWords2] the number of rows in the misspelledWords aray . e You should do the following with phrase 1. 2. Separate the phrase into words. Call CheckWord on each word to check the spelling of the word and construct a corrected phrase. o Note: the resulting phrase will contain "unknown if any words are not found in the arrays 3. Open the outputFile in append mode. 4. Append the corrected phrase to the output file. NOTE: Your outputfile should end with an extra line (A new line character). This is to ensure that each time you add lines to it, it starts from a new line. Edge Conditions Your program should print 'Phrase is empty. Nothing to write in file. to the console if your phrase is empty. Note: Your program should not write anything to the output file in this case. . Your program should print Unable to createl access output file. if you're not able to access your output file. Example: If I call CheckPhrase with the phrase "chicken fish and bubbls the arrays specified in the previous examples, and this output file: outputFile.txt (Before function call) ocean bubbles unknown pear bubbles fish unknown unknown fish then I would expect the output file to look like this after the function call. outputFile.txt (After function call) ocean bubbles unknown pear bubbles fish unknown unknown fish chicken fish unknown bubbles Write a function CheckPhrase to check spelling in a phrase. It should have the following parameters: a string phrase, a string outputFile e an array of strings correctWords Size of the array correctWords a 2D aray of strings misspelledWords2] the number of rows in the misspelledWords aray . e You should do the following with phrase 1. 2. Separate the phrase into words. Call CheckWord on each word to check the spelling of the word and construct a corrected phrase. o Note: the resulting phrase will contain "unknown if any words are not found in the arrays 3. Open the outputFile in append mode. 4. Append the corrected phrase to the output file. NOTE: Your outputfile should end with an extra line (A new line character). This is to ensure that each time you add lines to it, it starts from a new line. Edge Conditions Your program should print 'Phrase is empty. Nothing to write in file. to the console if your phrase is empty. Note: Your program should not write anything to the output file in this case. . Your program should print Unable to createl access output file. if you're not able to access your output file. Example: If I call CheckPhrase with the phrase "chicken fish and bubbls the arrays specified in the previous examples, and this output file: outputFile.txt (Before function call) ocean bubbles unknown pear bubbles fish unknown unknown fish then I would expect the output file to look like this after the function call. outputFile.txt (After function call) ocean bubbles unknown pear bubbles fish unknown unknown fish chicken fish unknown bubbles