-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcCliente.cpp
More file actions
27 lines (23 loc) · 797 Bytes
/
cCliente.cpp
File metadata and controls
27 lines (23 loc) · 797 Bytes
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
#include "cCliente.h"
#include <sstream>
cCliente::cCliente(string DNI, string apellido, tm FechaNac, string TipoLicencia)
{
this->apellido = apellido;
this->DNI = DNI;
this->FechaNac = FechaNac;
this->TipoLicencia = TipoLicencia;
}
string cCliente::ToString()
{
/*Este metodo convierte todo los atributos de la clase a un tipo de dato string*/
stringstream sc; /*creamos un buffer para concatenar todos los atributos de la clase*/
sc << "Apellido: " << apellido << endl;
sc << "Fecha de Nacimiento: " << FechaNac.tm_mday << "/" << FechaNac.tm_mon << "/" << FechaNac.tm_year << endl;
sc << "DNI: " << DNI << endl;
sc << "Tipo de Licencia: " <<TipoLicencia << endl;
return sc.str();
}
void cCliente::Imprimir()
{
cout << ToString() << endl;
}