-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImpresor.cpp
More file actions
163 lines (140 loc) · 4 KB
/
Impresor.cpp
File metadata and controls
163 lines (140 loc) · 4 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#include "Impresor.h"
int Impresor::pedir_opcion(){
string opcion;
cout << VIOLETA << "\n\t\tIngresar opcion: ";
cin >> opcion;
return atoi(opcion.c_str());
}
string Impresor::pedir_titulo(){
string titulo;
cout << NEGRO << "Ingrese el título de la lectura: ";
cin.ignore();
getline(cin, titulo);
return titulo;
}
int Impresor::pedir_anio(){
int anio;
cout << NEGRO << "Ingrese el anio de publicacion de la lectura: ";
cin >> anio;
return anio;
}
int Impresor::pedir_minutos(){
int minutos;
cout << "Ingrese minutos promedio de lectura: ";
cin >> minutos;
return minutos;
}
int Impresor::pedir_tipo(){
int tipo;
cout << NEGRO << "Ingrese el numero de la lectura que deseas crear ";
cout << AMARILLO << "(1. POEMA / 2. CUENTO / 3. NOVELA): ";
cin >> tipo;
return tipo;
}
int Impresor::pedir_versos(){
int versos;
cout << VERDE << "Ingrese la cantidad de versos del poema: ";
cin >> versos;
return versos;
}
string Impresor::pedir_libro(){
string libro;
cout << "Ingrese el titulo del libro: ";
cin.ignore();
getline(cin, libro);
return libro;
}
generos Impresor::pedir_genero(){
int genero;
cout << "Ingrese el género de la novela (numero entero) " << endl;
cout << AMARILLO << "(1.DRAMA / 2.COMEDIA / 3.FICCION / 4.SUSPENSO / 5.TERROR / 6.ROMANTICA / 7.HISTORICA): "<< endl;
cin >> genero;
while(genero > 7 || genero < 1){
cout << ROJO << "Dato incorrecto! Ingrese un genero valido" << endl;
cout << AMARILLO << "(1.DRAMA / 2.COMEDIA / 3.FICCION / 4.SUSPENSO / 5.TERROR / 6.ROMANTICA / 7.HISTORICA): "<< endl;
cin >> genero;
}
return (generos) genero;
}
string Impresor::pedir_tema(){
string tema;
cout << NEGRO << "Ingrese el tema de la novela histórica: ";
cin.ignore();
getline(cin, tema);
return tema;
}
string Impresor::pedir_isni(){
string isni;
cout << AZUL << "Ingrese isni del escritor: ";
cin.ignore();
getline(cin, isni);
return isni;
}
string Impresor::pedir_isni(int sobrecargar){
string isni;
cout << AZUL << "Ingrese isni del escritor (Ingrese 0 si es ANONIMO): ";
cin.ignore();
getline(cin, isni);
return isni;
}
string Impresor::pedir_nombre(){
string nombre;
cout << AZUL << "Ingrese el nombre del escritor: ";
getline(cin, nombre);
return nombre;
}
string Impresor::pedir_nombre_escritor(){
string nombre;
cout << AZUL << "Ingrese el nombre del escritor: ";
cin.ignore();
getline(cin, nombre);
return nombre;
}
string Impresor::pedir_nacionalidad(){
string nacionalidad;
cout << AZUL << "Ingrese la nacionalidad: " << endl;
cout << VERDE << " (si es desconocida, ingrese ¿?): ";
cin >> nacionalidad;
return nacionalidad;
}
int Impresor::pedir_nacimiento(){
int nacimiento;
cout << AZUL << "Ingrese el año de nacimiento: " << endl;
cout << VERDE << " (si es desconocida, ingrese -1): ";
cin >> nacimiento;
return nacimiento;
}
int Impresor::pedir_fallecimiento(){
int fallecimiento;
cout << AZUL << "Ingrese el año de fallecimiento: " << endl;
cout << VERDE << "(si es desconocida o continua vivo, ingrese -1): ";
cin >> fallecimiento;
return fallecimiento;
}
int Impresor::pedir_anio_desde(){
int desde;
cout << VERDE << "Ingrese el año DESDE el cual desea listar las lecturas: ";
cin >> desde;
return desde;
}
int Impresor::pedir_anio_hasta(){
int hasta;
cout << VERDE << "Ingrese el año HASTA el cual desea listar las lecturas: ";
cin >> hasta;
cout << '\n';
return hasta;
}
char Impresor::opcion_leer(){
char opcion;
cout << AZUL << "\nDesea marcar la lectura de la cola como leida?" << endl;
cout << VERDE << " (S.Si / N.No): ";
cin >> opcion;
return opcion;
}
char Impresor::seguir_listando(){
char opcion;
cout << AZUL << "\n Desea seguir listando Lecturas?" << endl;
cout << VERDE << " (S.Si / N.No): ";
cin >> opcion;
return opcion;
}