-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsuario.h
More file actions
42 lines (40 loc) · 1.93 KB
/
Copy pathUsuario.h
File metadata and controls
42 lines (40 loc) · 1.93 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
#pragma once
#include <iostream>
#include <functional>
#include <string>
using namespace std;
class Usuario
{
private:
string nombre;
string alias;
string pais;
string email;
short edad;
int telefono;
int *puntuacion;
int puntos;
int numeracion;
public:
Usuario(int numeracion = 0, string nombre = " ", string alias = " ", string pais = " ", short edad = 0, int telefono = 0,string email=" ", int puntos = 0) :numeracion(numeracion), nombre(nombre), alias(alias),pais(pais), edad(edad), telefono(telefono),email(email), puntos(puntos) { puntuacion = new int; *puntuacion = puntos; }
~Usuario() {}
int getNumeracion() { return numeracion; }
void setNumeracion(int valor) { numeracion = valor; }
string getNombre() { return nombre; }
void setNombre(string nuevo) { nombre = nuevo; }
string getAlias() { return alias; }
void setAlias(string nuevo) { alias = nuevo; }
string getPais() { return pais; }
void setPais(string nuevo) { pais = nuevo; }
short getEdad() { return edad; }
void setEdad(short nuevo) { edad = nuevo; }
int getTelefono() { return telefono; }
void setTelefono(short nuevo) { telefono = nuevo; }
int getPuntuacion() { return *puntuacion; }
void setPuntuacion(int nuevo) { *puntuacion = nuevo; }
void addPuntuacion(int valor) { *puntuacion = *puntuacion + valor; }
string getEmail() { return email; }
void setEmail(string nuevo) { email = nuevo; }
string toString() { return to_string(numeracion) + ". Nombre: " + nombre + " - Alias: " + alias + " - Pais: " + pais + " - Edad: " + to_string(edad) + " - Telefono: " + to_string(telefono) + " - Email: " + email + " - Puntos: " + to_string(*puntuacion); }
string toString2() { return "Nombre: " + nombre + " - Alias: " + alias + " - Pais: " + pais + " - Edad: " + to_string(edad) + " - Telefono: " + to_string(telefono) + " - Email: " + email + " - Puntos: " + to_string(*puntuacion); }
};