{ Visit: http://g-lts.info/ for more code! } # include # include using namespace std; class person { private: string name,lastname; string telephone; public: person(); void setname(string s); void setlastname(string s); bool settelephone(string s); string getname(); string getlastname(); string gettelephone(); void printdetails(); bool relative(person other); ~person(); }; person::person() { name="-"; lastname="-"; telephone="-"; } void person::setname(string s) { name=s; } void person::setlastname(string s) { lastname=s; } bool person::settelephone(string s) { int i; //1η Περίπτωση. if(s.size()!=10) return false; //2η Περίπτωση. if(s[0]=='0') return false; // Έλεγχος όλων των χαρακτήρων του string - αριθμού, ΑΝ βρίσκονται στο [0-9]. for(i=0;i='0' && s[i]<='9')) return false; } // Αν κατάφερε να περάσει τους παραπάνω ελέγχους τότε ας το δεκτό. telephone = s; return true; } string person::getname() { return name; } string person::getlastname() { return lastname; } string person::gettelephone() { return telephone; } void person::printdetails() { cout<<"Name: "<