Description Instructions Create a C++ dictionary app with a loop that prompts the user for words to look up. Study the https://github.com/fromlc/ex9_dictionary.git Use the global string arrays dict::words and dict: defs for words and definitions. You may add words and their definitions if you wish.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →Description
Instructions
Create a C++ dictionary app with a loop that prompts the user for words to look up.
- Study the https://github.com/fromlc/ex9_dictionary.git
- Use the global string arrays dict::words and dict: defs for words and definitions. You may add words and their definitions if you wish.
- Good code recognizes commands typed in any case, but for this exercise search for the word exactly as the user types it.
- Don’t worry about validating user input – assume valid input for this exercise.
- Get your lookup working first, and only then should you code the user prompt loop.
- Write a function named lookup_word) that looks up words in the dict:words array.
- Your function should accept two arguments:
- a string reference parameter for the word to look up, and
- a string reference parameter to hold the returned definition.
- Your function should return an int that holds either:
- the index of the word’s definition in the dict::words and dict::defs arrays, OR
o -1 if the word is not found in dict.:words array
- In your function lookup_word(), call the string compare() function in a loop to search for the a word
- Start by searching for a hard-coded word (“cat” or “dog”).
- Once you can display a word’s correct definition, add the user prompt loop and look up the user’s words.
- Terminate your loop when the user types
“quit” in all lowercase.
Submitting your work
- Check the assignment rubric,
- Test your code,
- Fix all compiler errors and warnings, and
- Submit your completed cp file.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds