'Backup'
This commit is contained in:
parent
acdcd6feb9
commit
6751e98421
@ -31,6 +31,15 @@ string Human::getFirstname() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Human::setFirstname(string firstname) {
|
void Human::setFirstname(string firstname) {
|
||||||
|
if (firstname.length() <= 0) {
|
||||||
|
cout << "First name is empty" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (firstname.find("_", 0) >= 0
|
||||||
|
&& firstname.find("_", 0) < 10000000000) {
|
||||||
|
cout << "First name contains illegal character _" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this->firstname = firstname;
|
this->firstname = firstname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ int main() {
|
|||||||
// cout << "pesel of employee" << e.getPesel();
|
// cout << "pesel of employee" << e.getPesel();
|
||||||
|
|
||||||
lib::Librarian l = lib::Librarian();
|
lib::Librarian l = lib::Librarian();
|
||||||
|
l.setFirstname("Arek");
|
||||||
|
cout << "First name: " << l.getFirstname() << endl;
|
||||||
l.setPesel(2000000000);
|
l.setPesel(2000000000);
|
||||||
if (l.validate())
|
if (l.validate())
|
||||||
cout << "pesel of librarian" << l.getPesel();
|
cout << "pesel of librarian" << l.getPesel();
|
||||||
|
Loading…
Reference in New Issue
Block a user