Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now that we have the words stored, it is time to provide functions that allow users to use our dictionary. Add and implement the following

Now that we have the words stored, it is time to provide functions that allow users to use our dictionary. Add and implement the following functions:

/* @param : The string with a query word @return : Integer index of the word in `g_words` global-array. Returns -1 if the word is not found @post : Find the index of given `word` in the `g_words` array. Return -1 if word is not in the array */ int getIndex(string word); /* @param : The string with a query word @return : Return the string definition of the word from `g_definitions` global-array. Return "NOT_FOUND" if word doesn't exist in the dictionary @post : Find the definition of the given `word` Return "NOT_FOUND" otherwise */ string getDefinition(string word); /* @param : The string with a query word @return : Return the string part-of-speech(pos) from the `g_pos` global-array. Return "NOT_FOUND" if the word doesn't exist in the dictionary. @post : Find the pos of the given `word` Return "NOT_FOUND" otherwise */ string getPOS(string word); /* @param : The string prefix of a word (the prefix can be of any length) @return : Integer number of words found that starts with the given `prefix` @post : Count the words that start with the given `prefix` */ int countPrefix(string prefix); 

Remember to test each function before moving on to implement the next one. Similar to Task A, submit only one .cpp file without the main() function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

=+ Provide job assignments and meet as needed to answer questions.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago