forked from ab-rohman/Open-Hack2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ferdi.java
31 lines (29 loc) · 908 Bytes
/
Ferdi.java
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.Scanner;
public class Ferdi{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int nilai;
System.out.print("Masukkan nilai: ");
nilai = input.nextInt();
if(nilai >= 0 && nilai <= 100){
if (nilai >= 90 && nilai <= 100){
System.out.println("Nilai A");
}
else if(nilai >= 80 && nilai <= 89){
System.out.println("Nilai B");
}
else if(nilai >= 60 && nilai <= 79){
System.out.println("Nilai C");
}
else if(nilai >= 50 && nilai <= 59){
System.out.println("Nilai D");
}
else{
System.out.println("Nilai E");
}
}
else{
System.out.println("Nilai yang anda masukkan tidak valid");
}
}
}