diff options
clean up
1 files changed, 0 insertions, 40 deletions
| -rw-r--r-- | Sem. 07/Person/Person.cpp | 40 |
diff --git a/Sem. 07/Person/Person.cpp b/Sem. 07/Person/Person.cpp deleted file mode 100644 index 2786671..0000000 --- a/Sem. 07/Person/Person.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include <iostream> -#include "Person.h" - -Person::Person(const char* name, int age) -{ - setName(name); - setAge(age); -} - - -void Person::setName(const char* name) -{ - if (strlen(name) >= 20) - { - strcpy(this->name, "Unknown"); - } - else - { - strcpy(this->name, name); - } -} - -void Person::setAge(int age) -{ - if (age<0 || age > 120) - age = 40; - this->age = age; -} -const char* Person::getName() const -{ - return name; -} -int Person::getAge() const -{ - return age; -} -void Person::print() -{ - std::cout << name << " " << age << std::endl; -}
\ No newline at end of file |
