Question: programming language C++ The purpose of this assignment is to give you practice using dynamic memory allocation, c-string functions, sorting, and searching. You will write

programming language C++

The purpose of this assignment is to give you practice using dynamic memory allocation, c-string functions, sorting, and searching. You will write spell checking program and test it.

Program Steps

Read a dictionary word file into an array of c-strings. You will need to dynamically allocate memory for each word in the dictionary. The word file contains 23907 word

Sort the dictionary.

Reading in a test file, one line at a time. Parse the line to get each individual word in the line. Search the dictionary word list (the array of c-strings) for each word in the line. If the word is not found, print a message. The search should be performed as a binary search.

Program Requirements

  • Use these files for your dictionary and the final spell check test.
  • Use an array of char pointers store your word file.Allocate memory dynamically to store each word in a char array.Store the dictionary words in lower case.
  • Use a temporary char array to hold each line in the test file. "Parse" each line into individual words for spell checking. not use the stringstream classes
  • Spell checking must ignore case. For example, "Hello" is the same as "hello".
  • If the word ends in s, then you must also check the word with the s removed. For example, years is not misspelled because year is in the dictionary.

Program Output

Your output should looks quite similar to this:

Misspelled word, withering on line 4

Misspelled word, captivity on line 5

Misspelled word, dramatize on line 12

Misspelled word, nation's on line 13

Misspelled word, tranquilizing on line 28

Misspelled word, gradualism on line 29

Misspelled word, God's on line 31

Misspelled word, Negro's on line 35

Misspelled word, whirlwinds on line 41

...

There should be slightly more than 20 misspelled words.

  • For your dictionary sort, you can "swap pointers" since you are working with an array of pointers.
  • Use strtok() for the parsing of each line.

Thank you

Due 5/12/2020

9:00 AM

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!