Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code this using C++ and comment on each section to understand the code. Other attachments include: My header files DEntry.h and Dictionary.h, which you may

Code this using C++ and comment on each section to understand the code.

Other attachments include:

  • My header files DEntry.h and Dictionary.h, which you may use in full, as a starting point, or not at all

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

DEntry.h /* Instructor solution for Program 2: Dictionary Dictionary entry class (DEntry) definition */ #ifndef DEntry_h #define DEntry_h #include using std::string; #include using std::ostream; class DEntry { public: void writeEntry(string w, string p, string d); // Write data to entry void printEntry(ostream &out); // Print contents of entry string getWord(); // Access word private: string word; // Word string part; // Part of speech string defn; // Definition }; #endif // DEntry_h

Dictionary.h

/* Instructor solution for Program 2: Dictionary Dictionary class definition */ #ifndef Dictionary_h #define Dictionary_h #include using std::ostream; #include "DEntry.h" // Implicitly includes class Dictionary { public: Dictionary(); bool addWord(string w, string p, string d); // Add word to dictionary bool addFile(string fname); // Add file contents to dictionary // Both functions return true if successful bool find(DEntry &entry, string word); // Find entry containing word void printAll(ostream &out); // Print all entries void printLetter(ostream &out, char letter); // Print all entries with word starting // with letter private: DEntry entries[100]; // Array of dictionary entries unsigned size; // Number of entries currently in dictionary unsigned posn(string w); // Position in which word w either exists or should be placed }; #endif // Dictionary_h

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions