#include #include "WordArrayT.h" #include "WordArraySupport.h" using namespace std; void TestPassByValue(WordArrayT words); int main() { WordArrayT words; cout << "The empty array" << endl; PrintWords(words); cout << endl << endl; cout << "Adding hello" << endl; AddWord(words, "hello"); PrintWords(words); cout << endl << endl; cout << "Adding world" << endl; AddWord(words, "world"); PrintWords(words); cout << endl << endl; cout << "Adding hello again" << endl; AddWord(words, "hello"); PrintWords(words); cout << endl << endl; cout << "Adding a " << endl; AddWord(words, "a"); cout << "Adding zebra" << endl; AddWord(words, "zebra"); cout << "Adding frequent" << endl; AddWord(words, "frequent"); cout << "Adding frequent x 3" << endl; AddWord(words, "frequent"); AddWord(words, "frequent"); AddWord(words, "frequent"); PrintWords(words); cout << endl << endl; cout << "Sorting By Word" << endl; SortByWord(words); PrintWords(words); cout << endl << endl; cout << "Sorting by Frequency" << endl; SortByCount(words); PrintWords(words); cout << endl << endl; cout << "Adding b" << endl; AddWord(words, "b"); cout << "Adding c" << endl; AddWord(words, "c"); cout << "Adding d" << endl; AddWord(words, "d"); cout << "Adding e" << endl; AddWord(words, "e"); cout << "Adding f" << endl; AddWord(words, "f"); cout << "Adding g" << endl; cout << "This should produce an error " << endl; AddWord(words, "g"); PrintWords(words); cout << endl << endl; cout << "Sorting By Word" << endl; SortByWord(words); PrintWords(words); cout << endl << endl; cout << "Testing pass by value " << endl; TestPassByValue(words); return 0; } void TestPassByValue(WordArrayT words){ PrintWords(words); }