-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
55 lines (43 loc) · 1.12 KB
/
main.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
#include <iostream>
#include <string>
#include "Simulation.h"
#include "utils.h"
using namespace std;
int main() {
// opciones
string options[] = {
"Iniciar",
"Salir"
};
int optionsLength = 2;
// estado del programa
bool shouldContinue = true;
do {
cout << "----- Simulacion de Supermercado -----\n" << endl;
// mostrar opciones
displayOptions(options, optionsLength);
cout << endl;
// pedir y leer opcion
int option = getOption("Opcion: ", 1, optionsLength);
cout << endl;
// ejecutar accion de acuerdo a opcion elegida
switch(option) {
case 1: {
// pedir parametros
Simulation S;
cout << endl;
// ejecutar simulacion
S.run();
cout << endl;
break;
}
case 2:
shouldContinue = false;
break;
default:
cout << "Opcion invalida" << endl;
}
cout << endl;
} while(shouldContinue);
return 0;
}