here is the .cpp file
here is the header file
here is the instructions and psuedo code
1 #include "Dictionary.h" 2 3 // Your code here 4 5 6 7 LOCO // The copy constructor is complete. // However, the operator= must be completed for it to work. Dictionary::Dictionary(const Dictionary &otherDict) { root = new Node; numWords = 0; *this = otherDict; } 10 11 12 13 14 15 #ifndef BOGGLE_DICTIONARY_H #define BOGGLE_DICTIONARY_H 2 3 4 5 #include
#include #include using namespace std; G 7 8 9 10 const int NUM_CHARS - 26; 11 12 13 14 15 1 16 17 19 class Dictionary Error public: explicit DictionaryError(string mse) { this->msg = mg; > string Msg return me; // returns king of flavor } private: string msg; }; 19 20 21 22 23 24 class Dictionary 25 26 27 28 29 30 31 public: Dictionary(); --Dictionary(); // I will not require this Dictionary(const Dictionary& otherDict); explicit Dictionary (strine filename); // copy constructor // The keyword explicit is used to tell the compiler // that this is not a conversion constructor. 32 33 34 Dictionary& operator=(const Dictionary& otherDict); void LoadDictionaryFile(string filename); void SaveDictionaryFile(string Filename); 35 36 37 38 void Addlord(string word); void MakeEmpty(); 39 41 42 43 bool Isword(string word); bool ISPrefix(string word); int WordCount(); private: 48 49 class Node public: // Your node structure here. // You can also use a struct if you like. 50 51 52 ); 53 54 Node* roots int nunilords; 55 56 57 59 59 60 // Any private methods you need/want // You may change these helpers if you want, but you don't need to. void destroyHelper (Node* thisTree); void copyHelper (Node"& thisTree, Node & otherTree); void SaveDictionaryHelper (Node> curr, string currPrefix, of stream& outfile); }; 62 63 #endif //BOGGLE_DICTIONARY_H .. 2. W SH ISIRS . ...... .. . In :1 .... " TT" PE RISE ALL . - ...... Fr. 1 #include "Dictionary.h" 2 3 // Your code here 4 5 6 7 LOCO // The copy constructor is complete. // However, the operator= must be completed for it to work. Dictionary::Dictionary(const Dictionary &otherDict) { root = new Node; numWords = 0; *this = otherDict; } 10 11 12 13 14 15 #ifndef BOGGLE_DICTIONARY_H #define BOGGLE_DICTIONARY_H 2 3 4 5 #include #include #include using namespace std; G 7 8 9 10 const int NUM_CHARS - 26; 11 12 13 14 15 1 16 17 19 class Dictionary Error public: explicit DictionaryError(string mse) { this->msg = mg; > string Msg return me; // returns king of flavor } private: string msg; }; 19 20 21 22 23 24 class Dictionary 25 26 27 28 29 30 31 public: Dictionary(); --Dictionary(); // I will not require this Dictionary(const Dictionary& otherDict); explicit Dictionary (strine filename); // copy constructor // The keyword explicit is used to tell the compiler // that this is not a conversion constructor. 32 33 34 Dictionary& operator=(const Dictionary& otherDict); void LoadDictionaryFile(string filename); void SaveDictionaryFile(string Filename); 35 36 37 38 void Addlord(string word); void MakeEmpty(); 39 41 42 43 bool Isword(string word); bool ISPrefix(string word); int WordCount(); private: 48 49 class Node public: // Your node structure here. // You can also use a struct if you like. 50 51 52 ); 53 54 Node* roots int nunilords; 55 56 57 59 59 60 // Any private methods you need/want // You may change these helpers if you want, but you don't need to. void destroyHelper (Node* thisTree); void copyHelper (Node"& thisTree, Node & otherTree); void SaveDictionaryHelper (Node> curr, string currPrefix, of stream& outfile); }; 62 63 #endif //BOGGLE_DICTIONARY_H .. 2. W SH ISIRS . ...... .. . In :1 .... " TT" PE RISE ALL . - ...... Fr