Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please provide C++ code only. Visual Studio will be used for compilation. A dictionary is a collection of words that contain at least one definition.
Please provide C++ code only. Visual Studio will be used for compilation.
A dictionary is a collection of words that contain at least one definition. One way to represent a dictionary is through the use of an array, actually two arrays. For a dictionary to print the term with matching definition, each array 1. Must contain the same number of elements as the other array. 2. Each element in array 1 (term) must contain a match in array 2 (definition) Take the following array examples Array 1- ["clock", "bookcase"] Array 2 ['Time Keeper", "A place to store books'"] Instructions DESIGN and write a program that gets input from the user for contents of a dictionary. The program must contain at least two functions: one for inputting the user data and one for outputting the user data. The user specifies the number of dictionary terms and the program must ask the user for each term/definition pairing The program must be able to store the terms in memory and output each term/definition. The program must: 1. 2. Ask the user for number of dictionary entries. For each new entry a. Ask the user for the word. b. Ask the user for the definitiorn c. Store the word in one array. d. Store the definition in the other array. 3. 4. Output all the dictionary entries that were stored Clean up memory and exit Things to consider: 1. How will you make sure one array is just as long than the other? 2. How would you pass each array to the two functions? 3. How to print out each term next to definition on the same line? 4. How would you ensure that the array can handle any amount of terms entered? 5. What if the user entered "O" for the number of terms and definitions? Requirements: 1. 2. This program MUST be able to support any amount of user input. This program MUST NOT use any of the Standard Template Library members (i.e. vectors, lists, maps, etc The string library CAN be used in this program (and highly encouraged!) 3. Sample Output How many terms do you want the dictionary to hold?5 Enter Term 1: Lion Enter the definition for "Lion": A ferocious animal that would likely not make a great pet. Enter Term 2: Bulldog Enter the definition for "Bulldog": The mascot for the greatest school in Mississippi! Enter Term 3: Starkville Enter the definition for "Starkville": An awesome place filled with awesome students! Enter Term 4: Oxford Enter the definition for "Oxford": A dreaded place filled with subpar students. Enter Term 5: Land Shark Enter the definition for "Land Shark": Oxford's next phase in its identity crisis. You entered: 1. Lion: A ferocious animal that would likely not make a great pet 2. Bulldog: The mascot for the greatest school in Mississippi! 3. Starkville: An awesome place filled with awesome students! 4. Oxford: A dreaded place filled with subpar students. 5. Land Shark: Oxford's next phase in its identity crisis. How many terms do you want the dictionary to hold? 2 Enter Term 1: Yankey Doodle Enter the definition for "Yankey Doodle": Went to town, riding on a ponyl Enter Term 2: Football Enter the definition for "Footbal": Ironically, a sport where players seldomly use their feet to interact with the ball You entered: 1. Yankey Doodle: Went to town, riding on a pony 2. Football: Ironically, a sport where players seldomly use their feet to interact with the ballStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started