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.
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.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
