Question: Please do the coding as given in the instructions. I also provided the starter code and do it in C++ 1 Overview For this assignment,

 Please do the coding as given in the instructions. I alsoprovided the starter code and do it in C++ 1 Overview Forthis assignment, we will implement a simple typing tutor. The program willgive users the option to spell commonly misspelled words, display some wordsfrom one of the data sets, practice typing random words from adictionary, or to search for a word in the dictionary. The goalis to give students practice with - string comparisons - reading andaccessing data from files - implementing an algorithm (binary search) 2 TheProvided Files In this project, you will be working with data storedin external files. They are described below. - program3.cc the starter codethat will have all your work, and will be the file yousubmit for grading. - dictionary.txt holds a list of words that aresorted in alphabetical order. The format for the data is one wordon each line. - misspelled.txt a list of word pairs the misspelled

version of the word and the correctly spelled version of the word.The format is one pair per line, with the misspelled word first(then a space) followed by the correctly spelled version of that word.3 How To Work On This Assignment We are taking a differentapproach for this program by having you complete a collection of functions,each with their own role. We first prepared the solution and thenremoved the body of most of the functions. In later sections, wedescribe each menu option separately and functions in the starter code willreference their associated sections. While completing this assignment, there are important restrictionsyou need to follow. 4 Restrictions For Program 3 In the startercode, you will find 14 functions that need completing. We have listedPlease do the coding as given in the instructions. I also provided the starter code and do it in C++

1 Overview For this assignment, we will implement a simple typing tutor. The program will give users the option to spell commonly misspelled words, display some words from one of the data sets, practice typing random words from a dictionary, or to search for a word in the dictionary. The goal is to give students practice with - string comparisons - reading and accessing data from files - implementing an algorithm (binary search) 2 The Provided Files In this project, you will be working with data stored in external files. They are described below. - program3.cc the starter code that will have all your work, and will be the file you submit for grading. - dictionary.txt holds a list of words that are sorted in alphabetical order. The format for the data is one word on each line. - misspelled.txt a list of word pairs the misspelled version of the word and the correctly spelled version of the word. The format is one pair per line, with the misspelled word first (then a space) followed by the correctly spelled version of that word. 3 How To Work On This Assignment We are taking a different approach for this program by having you complete a collection of functions, each with their own role. We first prepared the solution and then removed the body of most of the functions. In later sections, we describe each menu option separately and functions in the starter code will reference their associated sections. While completing this assignment, there are important restrictions you need to follow. 4 Restrictions For Program 3 In the starter code, you will find 14 functions that need completing. We have listed them below, but note that the names might be slightly different if you selected the camel-case version of the starter code. That will be available soon. - display_header - report_misspell_mistakes - randn - evaluate_user_misspells - extract_dict - misspelled - extract_misspelled - full_dict - display_elems - print_range - extract_spelling_answers - display_in_range - extract_spelling_mistakes bsearch Each of these functions, has their own signature, which is their type and parameters. You are not allowed to change this. What this means is that you cannot 1. change what the function returns 2. change the number of parameters 3. change the type of the parameters 4. remove the const from any parameters. 5 Where To Submit Just like the previous two assignments, this one will be submitted to Gradescope. There, you can find an assignment called Program 3. We will provide an autograder as well, although it might not be available at the time of release. 6 At Program Start *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. When the program first starts, it should display the program title the size of the dictionary, and the number of commonly misspelled words. Make sure you do not hard code the number of words in the dictionary or the number of commonly misspelled words. We reserve the right to use a different dataset during grading, but we will always guarantee the specification in Section 2. 7 Menu Option 1: Spelling Misspelled For this first option, your program will select five random words from the misspelled.txt data set and have the user spell them correctly. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. truely grammer honourary concious therefor Type the words above with the correct spelling: truly grammar honorary conscious therefore No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x 6 points for each. Score: 15 The above example shows the output for selecting the first menu option, and then correctly typing all the misspelled words. If the user typed a word incorrectly, then we would have the following. Type the words above with the correct spelling: truly grammar honorary conscience therefar Misspelled words: conscience conscious therefar therefore 9 points: 3 spelled correctly x 3 points for each. 12 point penalty: 2 spelled incorrectly x6 points for each. Score: 3 The program will have to compare the answers given by the user with the correct answer. The scoring breaks down as follows - 3 points for each correct spelling - -6 points for each incorrect. 8 Menu Option 2: Typing From Dictionary *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 2 *** Using full dictionary. metapsychics roadshow fickles flouter springle Correctly type the words above: metapsychics roadshow fickles flouter springle No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 For this option, the user will be given five random words from dictionary.txt. If you have your solution to menu option 1 already, then this option might be easy for you to implement because you have functions that you can re-use here. Discovering this is exactly what we intend for you to do, so if you are struggling with this option (and are re-writing everything from scratch) then you should instead re-work your code for menu option 1 . Above, we show an example of the user correctly typing all words and below is when they have mistakes. Type the words above with the correct spelling: metapsychics roadshow fickles flouter sprinfle Misspelled words: sprinfle springle 12 points: 4 spelled correctly x 3 points for each. 6 point penalty: 1 spelled incorrectly x 6 points for each. Score: 6 9 Menu Option 3: Word Range For this option, the program will print out a range of words from the user's chosen data source. First, the user must select the data source. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: Each option will have one of the corresponding effects A. use words from dictionary.txt B. use words from misspelled.txt and display the wrongly spelled version. C. use words from misspelled.txt and display the correctly spelled version. After the user picks the source, your program must report the total range of valid indices. These range from 0(n1), where n is the number rows in the source. Then the user will provide two integers that represent the starting and ending index for the selected range. See the example below, which prints words from index 510. Your choice: A *** Enter the start and end indices between 0 and 263532: 510 5. aal 6. aalii 7. aaliis 8. aals 9. aardvark 10. aardvarks If the user gives values that are not in range or backwards, then display the following error message and return to the main menu. See the example below. *** Enter the start and end indices between 0 and 263532: 105 The end index must come after the start, and the indices must be in range. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 10 Menu Option 4: Binary Search For this menu option, your program will search dictionary.txt for a word given by the user. Your program will use the Binary Search algorithm. We provide an example bsearch.cc that searches through an array of integers. Below is an example of what the program's output will look like. Binary search works when the data, like dictionary.txt is sorted, and on every iteration of the algorithm it compares the midpoint in the data with the target. The program will print every word it compares with the target along the search path. Below is another example of the output, but when the search is unsuccessful. Your choice: 4 *** Enter word to search: otherx 1. Comparing to: mankier 2. Comparing to: rucs 3. Comparing to: pentadactyls 4. Comparing to: nonconceptual 5. Comparing to: outtake 6. Comparing to: oillets 7. Comparing to: orthogenetic 8. Comparing to: outers 9. Comparing to: otoscopies 10. Comparing to: ossicle 11. Comparing to: ostiaries 12. Comparing to: ostrichlike 13. Comparing to: otitic 14. Comparing to: otherwhile 15. Comparing to: otherworlds 16. Comparing to: otioseness 17. Comparing to: otiose 18. Comparing to: otic otherx was NOT found. 11 Example Output The format for all of the examples is that one option menu is selected, followed by an exit. 11.1 Option 1 *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. truely grammer honourary concious therefor Type the words above with the correct spelling: truly grammar honorary conscious therefore No misspelled words! 15 points: 5 spelled correctly x3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. ecstacy wierd Phillipines untill publically Type the words above with the correct spelling: ectacy weird Philipines until publicly Misspelled words: ectacy > ecstasy Philipines Philippines 12 points: 3 spelled correctly 3 points for each. Score: -3 spelled incorrectly 6 points for each. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5 . Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 2 *** Using full dictionary. subgovernment grinderies actinomorphic capitalizes encephalitogens Correctly type the words above: subgovernment grinderies actinomorphic capitalizes encephalitogens No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: b *** Enter the start and end indices between 0 and 113: 512 5. acheive 6. agressive 7. apparantly 8. appearence 9. arguement 10. assasination 11. basicly 12. begining *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: a *** Enter the start and end indices between 0 and 263532: -2 100 The end index must come after the start, and the indices must be in range. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 4 *** Enter word to search: computer 1. Comparing to: mankier 2. Comparing to: dormins 3. Comparing to: catechismal 4. Comparing to: crashworthy 5. Comparing to: cogon 6. Comparing to: consumptivenesses 7. Comparing to: compressing 8. Comparing to: confounders 9. Comparing to: concretionary 10. Comparing to: concentrator 11. Comparing to: computerphobes 12. Comparing to: compulsively 13. Comparing to: computations 14. Comparing to: computerises 15. Comparing to: computerdom 16. Comparing to: compute 17. Comparing to: computer computer was found. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 4 *** Enter word to search: phantome 1. Comparing to: mankier 2. Comparing to: rucs 3. Comparing to: pentadactyls 4. Comparing to: pugarees 5. Comparing to: polyploidy 6. Comparing to: pickle 7. Comparing to: phalange 8. Comparing to: photochronographs 9. Comparing to: philopena 10. Comparing to: phenazines 11. Comparing to: pharmacists 12. Comparing to: phantasimes 13. Comparing to: phantomatic 14. Comparing to: pharisaicalnesses 15. Comparing to: pharaohs 16. Comparing to: phantomy 17. Comparing to: phantomlike 18. Comparing to: phantomish phantome was NOT found. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. DMakefile + Makefile Hints : This is very similar to display elems, except you are not printinq / oid xtract_spelling_mistakes(vector dst, const string\& to_grade, const vector correct) /* TOD0: Populate the vector dst with all the spelling errors in the user's answer (to_grade). See Section "Menu Option 1: Spelling Misspelled" Parameters: dst an empty vector (of strings), passed by reference, that you will fill with strings that represent spelling errors (mispelling correct spelling) (see Hints) to_grade a string, passed by reference, that is not allowed to be modified (const) that holds the user's typed answer. correct a vector (strings), passed by reference, that is not allowed to be modified (const), which holds the correct answers. (one vector element one word) Hints: First you need to extract the answer, the user gave, for each word. Once you have those, you can compare it with the associated correct answer (answer ?= correct[i] for the ith word). You then populate the vector dst with a string that described the error. For example, if the word is "hello" and the user types "jello" then the error will be "jello hello". / oid eport_misspell_mistakes(const vector\& mistakes, const int num_words ) /* TOD0: Print out the spelling mistakes to the user. Following the format from the write-up. See Section "Menu Option 1: Spell- / TOD0: Print out the starting message for option 1, display 5 random words from the dictionary, finally evaluate the user's input. See "Menu Option 1: Spelling Misspelled". Parameters : mspelled a vector (string) where each element is one mispelled word from the data set correct a vector (string) where each element is a correctly spelled word from the data set Hints: Do not try to write this function first. The role of this function is to simply drive the whole procedure for menu option 1, it should be calling helper functions to handle the details of the sub tasks. Use randn, display_elems, and evaluate_user_misspells. Parameters: dict a vector (string), passed by reference, that cannot be modified (const), which holds the all the data from the full dictionary mspelled a vector (string), passed by reference, that cannot be modified (const), which holds the all the misspelled words correct a vector (string), passed by reference, that cannot be modified (const), which holds the all the words with correct spelling Hints : First write the function print_range, which will print data in a range (in general). This function should call print_range, but it will read in the user's choice of data set and call print_range with the user's choice. / \} void bsearch(const vector> data) \{ /* TOD0: Read in the word to search for, from the user, and run the Binary Search Algorithm to search for the word. At every step of the algorithm, print out the current word, that is being compared with the target. Parameters: data a vector (string), passed by reference, that cannot be modified (const), which holds the all the data from the full dictionary Hints : See our sample code to learn how the binary search algorithm works. Remember to output the text in the same format as you see in the write-up. / 1 Overview For this assignment, we will implement a simple typing tutor. The program will give users the option to spell commonly misspelled words, display some words from one of the data sets, practice typing random words from a dictionary, or to search for a word in the dictionary. The goal is to give students practice with - string comparisons - reading and accessing data from files - implementing an algorithm (binary search) 2 The Provided Files In this project, you will be working with data stored in external files. They are described below. - program3.cc the starter code that will have all your work, and will be the file you submit for grading. - dictionary.txt holds a list of words that are sorted in alphabetical order. The format for the data is one word on each line. - misspelled.txt a list of word pairs the misspelled version of the word and the correctly spelled version of the word. The format is one pair per line, with the misspelled word first (then a space) followed by the correctly spelled version of that word. 3 How To Work On This Assignment We are taking a different approach for this program by having you complete a collection of functions, each with their own role. We first prepared the solution and then removed the body of most of the functions. In later sections, we describe each menu option separately and functions in the starter code will reference their associated sections. While completing this assignment, there are important restrictions you need to follow. 4 Restrictions For Program 3 In the starter code, you will find 14 functions that need completing. We have listed them below, but note that the names might be slightly different if you selected the camel-case version of the starter code. That will be available soon. - display_header - report_misspell_mistakes - randn - evaluate_user_misspells - extract_dict - misspelled - extract_misspelled - full_dict - display_elems - print_range - extract_spelling_answers - display_in_range - extract_spelling_mistakes bsearch Each of these functions, has their own signature, which is their type and parameters. You are not allowed to change this. What this means is that you cannot 1. change what the function returns 2. change the number of parameters 3. change the type of the parameters 4. remove the const from any parameters. 5 Where To Submit Just like the previous two assignments, this one will be submitted to Gradescope. There, you can find an assignment called Program 3. We will provide an autograder as well, although it might not be available at the time of release. 6 At Program Start *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. When the program first starts, it should display the program title the size of the dictionary, and the number of commonly misspelled words. Make sure you do not hard code the number of words in the dictionary or the number of commonly misspelled words. We reserve the right to use a different dataset during grading, but we will always guarantee the specification in Section 2. 7 Menu Option 1: Spelling Misspelled For this first option, your program will select five random words from the misspelled.txt data set and have the user spell them correctly. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. truely grammer honourary concious therefor Type the words above with the correct spelling: truly grammar honorary conscious therefore No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x 6 points for each. Score: 15 The above example shows the output for selecting the first menu option, and then correctly typing all the misspelled words. If the user typed a word incorrectly, then we would have the following. Type the words above with the correct spelling: truly grammar honorary conscience therefar Misspelled words: conscience conscious therefar therefore 9 points: 3 spelled correctly x 3 points for each. 12 point penalty: 2 spelled incorrectly x6 points for each. Score: 3 The program will have to compare the answers given by the user with the correct answer. The scoring breaks down as follows - 3 points for each correct spelling - -6 points for each incorrect. 8 Menu Option 2: Typing From Dictionary *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 2 *** Using full dictionary. metapsychics roadshow fickles flouter springle Correctly type the words above: metapsychics roadshow fickles flouter springle No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 For this option, the user will be given five random words from dictionary.txt. If you have your solution to menu option 1 already, then this option might be easy for you to implement because you have functions that you can re-use here. Discovering this is exactly what we intend for you to do, so if you are struggling with this option (and are re-writing everything from scratch) then you should instead re-work your code for menu option 1 . Above, we show an example of the user correctly typing all words and below is when they have mistakes. Type the words above with the correct spelling: metapsychics roadshow fickles flouter sprinfle Misspelled words: sprinfle springle 12 points: 4 spelled correctly x 3 points for each. 6 point penalty: 1 spelled incorrectly x 6 points for each. Score: 6 9 Menu Option 3: Word Range For this option, the program will print out a range of words from the user's chosen data source. First, the user must select the data source. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: Each option will have one of the corresponding effects A. use words from dictionary.txt B. use words from misspelled.txt and display the wrongly spelled version. C. use words from misspelled.txt and display the correctly spelled version. After the user picks the source, your program must report the total range of valid indices. These range from 0(n1), where n is the number rows in the source. Then the user will provide two integers that represent the starting and ending index for the selected range. See the example below, which prints words from index 510. Your choice: A *** Enter the start and end indices between 0 and 263532: 510 5. aal 6. aalii 7. aaliis 8. aals 9. aardvark 10. aardvarks If the user gives values that are not in range or backwards, then display the following error message and return to the main menu. See the example below. *** Enter the start and end indices between 0 and 263532: 105 The end index must come after the start, and the indices must be in range. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 10 Menu Option 4: Binary Search For this menu option, your program will search dictionary.txt for a word given by the user. Your program will use the Binary Search algorithm. We provide an example bsearch.cc that searches through an array of integers. Below is an example of what the program's output will look like. Binary search works when the data, like dictionary.txt is sorted, and on every iteration of the algorithm it compares the midpoint in the data with the target. The program will print every word it compares with the target along the search path. Below is another example of the output, but when the search is unsuccessful. Your choice: 4 *** Enter word to search: otherx 1. Comparing to: mankier 2. Comparing to: rucs 3. Comparing to: pentadactyls 4. Comparing to: nonconceptual 5. Comparing to: outtake 6. Comparing to: oillets 7. Comparing to: orthogenetic 8. Comparing to: outers 9. Comparing to: otoscopies 10. Comparing to: ossicle 11. Comparing to: ostiaries 12. Comparing to: ostrichlike 13. Comparing to: otitic 14. Comparing to: otherwhile 15. Comparing to: otherworlds 16. Comparing to: otioseness 17. Comparing to: otiose 18. Comparing to: otic otherx was NOT found. 11 Example Output The format for all of the examples is that one option menu is selected, followed by an exit. 11.1 Option 1 *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. truely grammer honourary concious therefor Type the words above with the correct spelling: truly grammar honorary conscious therefore No misspelled words! 15 points: 5 spelled correctly x3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 1 *** Using commonly misspelled words. ecstacy wierd Phillipines untill publically Type the words above with the correct spelling: ectacy weird Philipines until publicly Misspelled words: ectacy > ecstasy Philipines Philippines 12 points: 3 spelled correctly 3 points for each. Score: -3 spelled incorrectly 6 points for each. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5 . Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 2 *** Using full dictionary. subgovernment grinderies actinomorphic capitalizes encephalitogens Correctly type the words above: subgovernment grinderies actinomorphic capitalizes encephalitogens No misspelled words! 15 points: 5 spelled correctly x 3 points for each. 0 point penalty: 0 spelled incorrectly x6 points for each. Score: 15 *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: b *** Enter the start and end indices between 0 and 113: 512 5. acheive 6. agressive 7. apparantly 8. appearence 9. arguement 10. assasination 11. basicly 12. begining *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 3 *** Displaying word list entries. Which words do you want to display? A. Dictionary of all words B. Commonly misspelled words (wrongly spelled) C. Commonly misspelled words (correctly spelled) Your choice: a *** Enter the start and end indices between 0 and 263532: -2 100 The end index must come after the start, and the indices must be in range. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 4 *** Enter word to search: computer 1. Comparing to: mankier 2. Comparing to: dormins 3. Comparing to: catechismal 4. Comparing to: crashworthy 5. Comparing to: cogon 6. Comparing to: consumptivenesses 7. Comparing to: compressing 8. Comparing to: confounders 9. Comparing to: concretionary 10. Comparing to: concentrator 11. Comparing to: computerphobes 12. Comparing to: compulsively 13. Comparing to: computations 14. Comparing to: computerises 15. Comparing to: computerdom 16. Comparing to: compute 17. Comparing to: computer computer was found. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. *** Typing Tutor There are 263533 words in the dictionary. There are 114 commonly misspelled words. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 4 *** Enter word to search: phantome 1. Comparing to: mankier 2. Comparing to: rucs 3. Comparing to: pentadactyls 4. Comparing to: pugarees 5. Comparing to: polyploidy 6. Comparing to: pickle 7. Comparing to: phalange 8. Comparing to: photochronographs 9. Comparing to: philopena 10. Comparing to: phenazines 11. Comparing to: pharmacists 12. Comparing to: phantasimes 13. Comparing to: phantomatic 14. Comparing to: pharisaicalnesses 15. Comparing to: pharaohs 16. Comparing to: phantomy 17. Comparing to: phantomlike 18. Comparing to: phantomish phantome was NOT found. *** Select a menu option: 1. Spell commonly misspelled words 2. Type random words from the full dictionary 3. Display some words from one of the lists 4. Use binary search to lookup a word in the dictionary 5. Exit the program. Your choice: 5 Exiting. DMakefile + Makefile Hints : This is very similar to display elems, except you are not printinq / oid xtract_spelling_mistakes(vector dst, const string\& to_grade, const vector correct) /* TOD0: Populate the vector dst with all the spelling errors in the user's answer (to_grade). See Section "Menu Option 1: Spelling Misspelled" Parameters: dst an empty vector (of strings), passed by reference, that you will fill with strings that represent spelling errors (mispelling correct spelling) (see Hints) to_grade a string, passed by reference, that is not allowed to be modified (const) that holds the user's typed answer. correct a vector (strings), passed by reference, that is not allowed to be modified (const), which holds the correct answers. (one vector element one word) Hints: First you need to extract the answer, the user gave, for each word. Once you have those, you can compare it with the associated correct answer (answer ?= correct[i] for the ith word). You then populate the vector dst with a string that described the error. For example, if the word is "hello" and the user types "jello" then the error will be "jello hello". / oid eport_misspell_mistakes(const vector\& mistakes, const int num_words ) /* TOD0: Print out the spelling mistakes to the user. Following the format from the write-up. See Section "Menu Option 1: Spell- / TOD0: Print out the starting message for option 1, display 5 random words from the dictionary, finally evaluate the user's input. See "Menu Option 1: Spelling Misspelled". Parameters : mspelled a vector (string) where each element is one mispelled word from the data set correct a vector (string) where each element is a correctly spelled word from the data set Hints: Do not try to write this function first. The role of this function is to simply drive the whole procedure for menu option 1, it should be calling helper functions to handle the details of the sub tasks. Use randn, display_elems, and evaluate_user_misspells. Parameters: dict a vector (string), passed by reference, that cannot be modified (const), which holds the all the data from the full dictionary mspelled a vector (string), passed by reference, that cannot be modified (const), which holds the all the misspelled words correct a vector (string), passed by reference, that cannot be modified (const), which holds the all the words with correct spelling Hints : First write the function print_range, which will print data in a range (in general). This function should call print_range, but it will read in the user's choice of data set and call print_range with the user's choice. / \} void bsearch(const vector> data) \{ /* TOD0: Read in the word to search for, from the user, and run the Binary Search Algorithm to search for the word. At every step of the algorithm, print out the current word, that is being compared with the target. Parameters: data a vector (string), passed by reference, that cannot be modified (const), which holds the all the data from the full dictionary Hints : See our sample code to learn how the binary search algorithm works. Remember to output the text in the same format as you see in the write-up. /

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 Databases Questions!