#include #include "CPstring.h" #include "list.h" #include "place.h" #include "printstate.h" PrintState::PrintState(const string & state) : myCount(0) // postcondition: contsructor { myState = state.Upcase(); } PrintState::~PrintState() // postcondition: destructor { // Do Nothing } void PrintState::Function(string & name, List &list) // postcondition: city(s) printed if in given state { for (list.First(); ! list.IsDone(); list.Next()) { if (list.Current().GetState() == myState) { // Print the State myCount++; cout << myCount << ". " << list.Current().GetName() << endl; } } } void PrintState::Report() // post condtion: prints results of Function { cout << "There were " << myCount << " cities in " << myState << endl; }