//---------------------------------------------------------------------------- #include #include #include #include "stringclass.h" //---------------------------------------------------------------------------- int main(void) { string NameString("Geoff Sutcliffe"), //----Note these will be initialized to empty by default constructor InputString, AgeString; //----Get input from user cout << "Please guess the age of " << NameString << " : "; cin >> InputString; //----Check if an integer if (InputString.CharsAreAll(isdigit)) AgeString = InputString; else AgeString = "unknown"; //----Add the age information to the name NameString += " has age "; NameString += AgeString; //----Output the answer cout << NameString << endl; //----End program return(0); } //----------------------------------------------------------------------------