-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoWhileLoop.java
More file actions
32 lines (28 loc) · 1.03 KB
/
DoWhileLoop.java
File metadata and controls
32 lines (28 loc) · 1.03 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
import java.util.Scanner;
public class DoWhileLoop {
public static void main (String [] args) {
int response = 0;
do {
System.out.println("Seleccione el numero de la opcion deseada: ");
System.out.println("1. Movies");
System.out.println("2. Series");
System.out.println("0. Salir");
Scanner sc = new Scanner(System.in);
response = Integer.valueOf(sc.nextLine());
switch (response) {
case 0:
System.out.println("Gracias por visitarnos");
break;
case 1:
System.out.println("Movies");
break;
case 2:
System.out.println("Series");
break;
default:
System.out.println("Seleccione una opcion correcta");
}
} while (response != 0);
System.out.println("Se termino el programa");
}
}