//-------------------------------------------------------------------- // // WordCount -- Implementation // //-------------------------------------------------------------------- //#include "stradt.h" #include "wordcount.h" WordCount::WordCount () // Create an empty string { my_count = 0; } void WordCount::initialize (Stradt new_word) // and count = 0 { my_word = new_word; my_count = 0; } Stradt WordCount::word () { return my_word; } int WordCount::count () { return my_count; } void WordCount::increment () // add 1 to count { my_count++; } void WordCount::reset () // set count to 0 { my_count = 0; } int WordCount::operator!= (WordCount another) { return !(my_word == another.word() ); }