Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is Task A for a c++ project where I have to make a dictionary text file and write a c++ program to read the
This is Task A for a c++ project where I have to make a dictionary text file and write a c++ program to read the file. This is the info given for task A but I don't understand whats supposed to be in the .cpp file that I submit.
A regular dictionary contains the words and the definitions. In addition to the words and the definitions, we will also store the part-of-speech (pos). The words, definitions and pos are going to be stored in Arrays. Use these global-variables in your code outside main() function: const int g_MAX_WORDS =1000; int g_word_count =0; string g_words[g_MAX_WORDS] ; string g_definitions[g_MAX_WORDS]; string g_pos[g_MAX_WORDS] ; Create a C++ file and add the following function: Here's an example text file: WORD POS : DEFINITION Grumpy Adjective : bad-tempered and irritable Professor Noun : a teacher of the highest rank in a college or university Does Verb : perform (an action, often of unspecified nature) Nothing Adverb : not at all Example: Calling readWords () on the above text file will modify the global variables like this: g_MAX_WORDS: 1000 g_word_count: 5 g_words: ["WORD", "Grumpy", "Professor", "Does", "Nothing"] g_pos: ["P0S", "Adjective", "Noun", "Verb", "Adverb"] g_definitions: [ "DEFINITION", "bad-tempered and irritable", "a teacher of the highest rank in a college or university", "perform (an action, often of unspecified nature)", "not at all" ] Make sure your program produces the correct output by testing the function and global-variables using function. Note: Only submit single file to gradescope. Remove or comment out the main function from your code before submitting it on gradescope. Otherwise, the autograder will fail
Step 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