#include #include #include #include #include using namespace std; class WordEntryT { public: WordEntryT() { count = 1; } void Word(string w) { word = w; } string Word(void) const { return word; } void Increment(void) { count ++; } int Count(void) const { return count; } bool operator < (const WordEntryT & other) { return word < other.word; } bool operator == (string compWord) { return word == compWord; } private: string word; int count; }; // 1 point, add the correct type to the function prototypes void Print(const /* enter type here */ & wordsList); void AddWord( /* enter type here */ wordList, string word); int main() { ifstream inFile ; inFile.open("words.dat"); // add code to declare a vector of WordEntryT // 1 point /* definition */ wordList; string word; inFile >> word; while(inFile) { AddWord(wordList, word); inFile >> word; } inFile.close(); // add code to sort the vector. // you do not need to implement a sort // use a member of the standard algorithm library // 2 points Print(wordList); return 0; } void AddWord( /* enter type here */ wordList, string word) { // 1 point, declare the iterator used below /* enter type here */ pos; WordEntryT entry; // locate the positon of the word in the list // You do not need to implement a function, // use a member of the algorithm library // 2 points pos = /* enter function call here */ if (pos == end(wordList)) { entry.Word(word); // add code to add the entry to the vector // 1 point } else { pos->Increment(); } return; } // complete this function, use either a range based for loop or iterators. // 2 points // // Print the values of the vector one per line. // Print the word first then print the number of times the word occured. void Print(const /* enter type here */ & wordsList) { return; }