Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

wrieC++ Prvgram: Impletet a Lexicon class using lists. This Leucon class will maintain a list of words, and the user will be ablie to quacry

image text in transcribed

wrieC++ Prvgram: Impletet a Lexicon class using lists. This Leucon class will maintain a list of words, and the user will be ablie to quacry the Lexicon as to whether or not a wool is inthe Lexicon, the us f will be able to bdd weeds to the Lexicon. or to modify a word in the Lexcon Lexicoe Lexiconl const string& fileName words in the file in the Lexicon ifthe fik docsn't exis, an exception should be thrown file and not aC++string object. To get the C-string oquivalent ef any given C++ string. A constructor that allows the wser to creatc an empty Lexicon A consuctoe that opens the file associated with fileName, and stores all of the N B. The ifse am coestructor takes a C-style string as a parameter to open the usg the member function For eample, so get the C-tring equivalont of fWe Name list string startWithchar ch): liststring stWit const string&prefix list string endWith char ch): listkstring endWith const string&suffis) void addWordcon sring&s void updateWordiconst string&target, const string& replacement) retums true if wond is in the Lexicon, and false otherwise. retums a list a ofwords that art with a particular letter, ck retums a list of woeds that start with profix retums list of words that end with a particult character, ck ret ms a list ofwords that end with , Adds str to the Lexicon if in is not there already. If it is there already, do nothing Changes the spelling of farget to bocome replacement Operaters friend bool operator (coest Lexiconk di, const Lescon&d retums true iff dl and d2 contain the same words, not necessanily in the same oeder. IN B be careful berc. You can not just assume that you can compare the lexioons word by word, since they may mot be stored in the same ordkr) friend operaor ost&, const Lexiconk dk Outputs the comtent ofthe Lexicem (in any order Submit Lesicon h.Lesicon opp, and useLexicoe.cpp files. Also, please use comments to document your code I have peovided 2 text files with the same lexicon, but I ran a pogram that has randomly pemuted the words such th they are no longer listed in sorted ender. When se files have been sMond into Lexicon objocts, your function should retum true

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

In the 1 9 3 0 s , Dr . Joseph Rhine tested 5 0 0 participants

Answered: 1 week ago