-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersona.cpp
More file actions
63 lines (47 loc) · 1.09 KB
/
Persona.cpp
File metadata and controls
63 lines (47 loc) · 1.09 KB
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
#include "Persona.h"
#include <sstream>
#include <iostream>
using namespace std;
//Constructor default
Persona::Persona(){
nombre="Cliente";
telefono=911;
correo="cliente@gmail";
}
//Constructor que recibe parámetros
Persona::Persona(string _nombre, int _telefono, string _correo){
nombre=_nombre;
telefono=_telefono;
correo=_correo;
}
//setters
//agregar datos a cada atributo de persona
void Persona::setNombre(string nom){
nombre=nom;
}
void Persona::setTelefono(int tel){
telefono=tel;
}
void Persona::setCorreo(string mail){
correo=mail;
}
//getters
//regresa los datos de cada atributo de persona
string Persona::getNombre(){
return nombre;
}
int Persona::getTelefono(){
return telefono;
}
string Persona::getCorreo(){
return correo;
}
//método que imprimeDatos
string Persona::imprimeDatos(){
stringstream aux;
aux<<"\nDatos personales"<<endl;
aux<<"Nombre: "<<nombre<<endl;
aux<<"Teléfono: "<<telefono<<endl;
aux<<"Correo: "<<correo<<endl;
return aux.str();
}