-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesafio01_verificaMes.java
More file actions
44 lines (38 loc) · 1.09 KB
/
Desafio01_verificaMes.java
File metadata and controls
44 lines (38 loc) · 1.09 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
42
43
44
package projeto_LPA.aula07;
import java.util.Scanner;
public class Desafio01_verificaMes {
public static void main(String[] args) {
Scanner ler = new Scanner(System.in);
int resposta;
System.out.println("Informe o número do mês");
resposta = ler.nextInt();
if (resposta == 1) {
System.out.println("janeiro");
} else if (resposta == 2) {
System.out.println("fevereiro");
} else if (resposta == 3) {
System.out.println("março");
} else if (resposta == 4) {
System.out.println("abril");
} else if (resposta == 5) {
System.out.println("maio");
} else if (resposta == 6) {
System.out.println("junho");
} else if (resposta == 7) {
System.out.println("julho");
} else if (resposta == 8) {
System.out.println("agosto");
} else if (resposta == 9) {
System.out.println("setembro");
} else if (resposta == 10) {
System.out.println("outubro");
} else if (resposta == 11) {
System.out.println("novembro");
} else if (resposta == 12) {
System.out.println("dezembro");
}else {
System.out.println("esse mes nao existe");
}
ler.close();
}
}