-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
57 lines (38 loc) · 1.52 KB
/
Main.java
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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("==================================");
System.out.println("MANIPULANDO UMA FILA CIRCULAR");
System.out.println("==================================");
System.out.print("\nQuantos itens haverão na fila ?: ");
int c = scan.nextInt();
FilaCircular novaFila = new FilaCircular(c);
int opcao = 0;
do {
System.out.println("1° • Adicionar valor");
System.out.println("2° • Remover valor");
System.out.println("3° • Listar valores");
System.out.println("0° • Adicionar valor");
opcao = scan.nextInt();
switch (opcao) {
case 1:
if (!novaFila.filaCheia()) {
System.out.print("Digite o valor para ser inserido: ");
novaFila.receberValor(scan.nextInt());
} else {
System.out.println("Lista cheia!");
}
break;
case 2:
novaFila.removerValor();
break;
case 3:
novaFila.listarFila();
break;
default:
break;
}
} while (opcao != 0);
}
}