// CSE143 Sp01 Homework 1 Sample Solution // wordlist.h - interface to WordList structure and functions // SRB 6/20 #include using namespace std; const int MAX_WORDS = 30; // maximum # of words in the list struct WordPair { // description of a word pair string wrongWord; // incorrectly spelled word string rightWord; // correctly spelled word }; struct WordList { // collection of WordPairs WordPair list[MAX_WORDS]; int size; }; // Make words an empty WordList void makeWordListEmpty(WordList &words); // Adds word pair to WordList with badWord as incorrectly spelled, and goodWord as correctly // spelled word. void addWord(WordList &places, string badWord, string goodWord); // Look for word in WordList words. If found, store coordinates of corrected Word in correctWord // and set found = 0; if not found set found = 1 and copy token to correctWord. void queryWordList(WordList &words, char *token, string &correctWord, int &found);