#include #include "WordListT.h" #include "WordT.h" using namespace std; WordListT::WordListT(){ size = 0; current = 0; } void WordListT::AddWord(string word){ if (size < MAX_WORDS) { words[size].Word(word); size++; } else { cout << "The word list is full" << endl; } } int WordListT::WordCount(void) const{ return size; } void WordListT::FirstWord(){ current = 0; } void WordListT::NextWord(){ if (current < size) { current ++; } } bool WordListT::PastLastWord(){ return current >= size; } void WordListT::FindWord(string word) { current = 0; while (current < size and words[current].Word() != word) { current ++; } } void WordListT::SetWord(WordT word) { if (current < size) { words[current] = word; } else { cout << "Current is invalid, not setting word" << endl; } } WordT WordListT::GetWord(){ WordT word; if (current < size) { word = words[current]; } else { cout << "Current is invalid, returning blank word" << endl; } return word; }