-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.cpp
65 lines (49 loc) · 1.41 KB
/
Person.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "Person.h"
using namespace std;
Person::Person(const string& name, unsigned int age, unsigned int dni, const string& address, const string& email, const std::string& phone)
: name(name), age(age), dni(dni), address(address), email(email), phone(phone){}
string Person::getName() const {
return name;
}
unsigned int Person::getAge() const {
return age;
}
unsigned int Person::getDni() const{
return dni;
}
string Person::getAddress() const {
return address;
}
string Person::getEmail() const {
return email;
}
string Person::getPhone() const {
return phone;
}
void Person::setName(const std::string& name){
this->name = name;
}
void Person::setAge(const unsigned int age){
this->age = age;
}
void Person::setDni(const unsigned int dni){
this->dni = dni;
}
void Person::setAddress(const std::string& address){
this->address = address;
}
void Person::setEmail(const std::string& email){
this->email = email;
}
void Person::setPhone(const std::string& phone){
this->phone = phone;
}
std::ostream& operator<<(std::ostream& os, const Person& person) {
os << "Nombre: " << person.name << std::endl;
os << "Edad: " << person.age << std::endl;
os << "DNI: " << person.dni << std::endl;
os << "Dirección: " << person.address << std::endl;
os << "email: " << person.email << std::endl;
os << "telefono: " << person.phone << std::endl;
return os;
}