-
Notifications
You must be signed in to change notification settings - Fork 0
/
MLibroVend.cpp
139 lines (107 loc) · 1.48 KB
/
MLibroVend.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* MLibroVend.h
* Creado: 23/05/2018
* Autor: Gustavo Rivero
* PD: ¡Protéico indefinido!
*/
#include "MLibroVend.h"
//Constructor
MLibroVend::MLibroVend()
{
//Inicialización de atributos numéricos
dia = 0;
metPago = 0;
}
//Set's y Get's correspondientes
void MLibroVend::setCodigoVend(string c)
{
codigoVend = c;
}
string MLibroVend::getCodigoVend()
{
return codigoVend;
}
void MLibroVend::setDia(int d)
{
dia = d;
}
int MLibroVend::getDia()
{
return dia;
}
void MLibroVend::setMetPago(int m)
{
metPago = m;
}
int MLibroVend::getMetPago()
{
return metPago;
}
//Métodos de cálculo
string MLibroVend::nombreDia()
{
//Declaración de variable local
string nombre;
//Convierte el valor de la variable "dia" en el string correspondiente
switch(dia)
{
case 1:
{
nombre = "Lunes";
break;
}
case 2:
{
nombre = "Martes";
break;
}
case 3:
{
nombre = "Miércoles";
break;
}
case 4:
{
nombre = "Jueves";
break;
}
case 5:
{
nombre = "Viernes";
break;
}
case 6:
{
nombre = "Sábado";
break;
}
}
//Retorno del valor string
return nombre;
}
string MLibroVend::nombrePago()
{
//Declaración de variable local
string pago;
//Convierte el valor int del 'metPago' en su respectivo valor string
switch(metPago)
{
case 1:
{
pago = "Débito";
break;
}
case 2:
{
pago = "Crédito";
break;
}
case 3:
{
pago = "Transferencia";
break;
}
}
//Retorno del valor string
return pago;
}