forked from bliblidotcom/training-java-future-program
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelloWorld.java
More file actions
28 lines (25 loc) · 762 Bytes
/
HelloWorld.java
File metadata and controls
28 lines (25 loc) · 762 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
import java.util.Scanner;
public class HelloWorld{
public static void main(String [] args){
Integer value = new Integer(0);
// System.out.println(args.length);
if (args.length < 1){
Scanner sc = new Scanner(System.in);
System.out.printf("masukan nilai : ");
value = sc.nextInt();
} else {
value = Integer.parseInt(args[0]);
}
if (value > 80) {
System.out.println("A");
} else if (value > 60){
System.out.println("B");
} else if (value > 40){
System.out.println("C");
} else if (value > 20){
System.out.println("D");
} else {
System.out.println("E");
}
}
}