void Amoeba::PrintGrandChildren () { Amoeba* child = myYoungestChild; while (child != 0) { child->PrintChildren(); child = child->myOlderSibling; } }
void Amoeba::IndentHelp (string ind) { cout << ind << Name() << endl; Amoeba* child = myYoungestChild; while (child != 0) { child->IndentHelp(ind + " "); child = child->myOlderSibling; } }
void Amoeba::PrintDescendants(string indent){ cout << indent << this->Name() << endl; Amoeba* child = myYoungestChild; while(child){ child->PrintDescendants(indent + " "); child = child->myOlderSibling; } }
void Amoeba::PrintGrandChildren(){ cout << "Here are my grandChildren: " <<endl; Amoeba* child = myYoungestChild; while (child){ child->PrintChildren(); child = child->myOlderSibling; } }
void Amoeba::PrintChildren(){ cout << "Here are my children: " << endl; Amoeba* child = myYoungestChild; while (child){ cout << "Hello, I'm " << child->Name() << endl; child = child->myOlderSibling; } }
void Amoeba::PrintChildren () { if (myYoungestChild == 0) { return; } else { Amoeba* child = myYoungestChild; while (child != 0) { cout << child->Name() << endl; child = child->myOlderSibling; } } }
void Amoeba::PrintDescendants () { string ind = ""; if (myYoungestChild == 0) { return; } else { Amoeba* child = myYoungestChild; while (child != 0) { child->IndentHelp(ind); child = child->myOlderSibling; } } }