-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiceCategorizer.java
More file actions
31 lines (29 loc) · 905 Bytes
/
Copy pathDiceCategorizer.java
File metadata and controls
31 lines (29 loc) · 905 Bytes
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
import java.util.*;
public class DiceCategorizer {
public static void main(String[] args) {
Random rand = new Random();
int number = rand.nextInt(6) + 1;
System.out.println("Generated number: " + number);
switch (number) {
case 1:
case 2:
System.out.println("Category: Small");
break;
case 3:
case 4:
System.out.println("Category: Medium");
break;
case 5:
case 6:
System.out.println("Category: Big");
break;
default:
System.out.println("Unexpected value");
}
if (number % 2 == 0) {
System.out.println("The number is Even.");
} else {
System.out.println("The number is Odd.");
}
}
}