-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRuletaEnJava.java
More file actions
34 lines (28 loc) · 1.18 KB
/
Copy pathRuletaEnJava.java
File metadata and controls
34 lines (28 loc) · 1.18 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
import java.util.Scanner;
// correr desde aqui
public class RuletaEnJava {
public static void main(String[] args) {
var participante = new GestorDeParticipantes();
var ruleta = new GestorRuleta();
Scanner src = new Scanner(System.in);
int opcion;
do {
System.out.println("\n Elige una opcion para la ruleta \n");
System.out.println("1- Agregar participante");
System.out.println("2- Ver participantes");
System.out.println("3- Agregar elemento a la ruleta");
System.out.println("4- Girar la ruleta");
System.out.println("0- Salir");
opcion = src.nextInt();
src.nextLine(); // clean buffer
switch (opcion) {
case 1 -> participante.agregarParticipante(src);
case 2 -> participante.verParticipantes();
case 3 -> ruleta.agregarElementoParaSortear(src);
case 4 -> ruleta.girarRuleta(participante.getParticipantes());
default -> System.out.println("Opcion invalida");
}
} while (opcion != 0);
src.close();
}
}