-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBodeSoftware.java
More file actions
41 lines (31 loc) · 1.14 KB
/
BodeSoftware.java
File metadata and controls
41 lines (31 loc) · 1.14 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
import javax.swing.*;
import java.util.*;
public class BodeSoftware {
public static void main(String[] args) {
Pessoa pessoa[] = new Pessoa[2];
String relatorio = "", men = "DIGITE SEU ID ";
Calendar data;
String usuario;
int i = 0, veri;
pessoa[0] = Pessoa.criar();
pessoa[1] = Pessoa.criar();
do{
veri = 0;
usuario = JOptionPane.showInputDialog(men);// uma janela para pedir o ID do usuario para saber quem estar usando
data = Calendar.getInstance();
for(int n = 0; n < pessoa.length && pessoa[n] != null; n++){
if(usuario.compareTo(pessoa[n].getId()) == 0){
relatorio += "ID "+ usuario+" || NOME "+ pessoa[n].getNome() + " || DATA HORA " + data.getTime()+" \n";
i++;
veri++;
}
}
if(veri == 0){
men = "ERRO 481 DIGITE SEU ID CORRETAMENTE";
}else{
men = "DIGITE SEU ID ";
}
}while(i < pessoa.length);
System.out.println("\n\n"+ relatorio +" \n\n");
}
}