-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
35 lines (34 loc) · 963 Bytes
/
Copy pathHelloWorld.java
File metadata and controls
35 lines (34 loc) · 963 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
32
33
34
35
public class HelloWorld {
public static void processIntegers () {
Scanner scan = new Scanner(System.in);
System.out.print("Enter three numbers: ");
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
if (a <= b) {
if (b > c) {
System.out.println("diamond");
} else {
System.out.println("ruby");
}
System.out.println("pearl");
} else if (b >= c) {
if (a < b) {
System.out.println("copper");
} else if (b == c) {
System.out.println("bronze");
}
System.out.println("silver");
if (a < c) {
System.out.println("gold");
}
} else {
System.out.println("penny");
if (a == b) {
System.out.println("dime");
} else {
System.out.println("nickel");
}
}
System.out.println("done");
}