-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchCase.java
More file actions
49 lines (46 loc) · 1.44 KB
/
Copy pathswitchCase.java
File metadata and controls
49 lines (46 loc) · 1.44 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
45
46
47
48
49
import java.util.Scanner;
public class switchCase {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter the year of birth: ");
int YoB = input.nextInt();
switch (YoB%12){
case 0:
System.out.println("Year of Monkey");
break;
case 1:
System.out.println("Year of Rooster");
break;
case 2:
System.out.println("Year of Dog");
break;
case 3:
System.out.println("Year of Pig");
break;
case 4:
System.out.println("Year of Rat");
break;
case 5:
System.out.println("Year of Ox");
break;
case 6:
System.out.println("Year of Tiger");
break;
case 7:
System.out.println("Year of Rabbit");
break;
case 8:
System.out.println("Year of Dragon");
break;
case 9:
System.out.println("Year of Snake");
break;
case 10:
System.out.println("Year of Horse");
break;
default:
System.out.println("Year of Sheep");
}
input.close();
}
}