#include "friend.h" #include "name.h" #include using namespace std; string Friend::toString() const { string fr(name.toString()); fr += "\n"; string pFormat("("); pFormat += phone.substr(0,3); pFormat += ") "; pFormat += phone.substr(3,3); pFormat += "-"; pFormat += phone.substr(6,4); fr += pFormat; return fr; } ostream& operator<<(ostream& out, const Friend & fr) { out << fr.toString(); return out; }