Untitled

Run Settings
LanguageJava
Language Version
Run Command
import java.util.Scanner; public class PenentuNilai { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Masukkan nilai: "); int nilai = scanner.nextInt(); String hurufNilai; if (nilai >= 80 && nilai <= 100) { hurufNilai = "A"; } else if (nilai >= 65 && nilai <= 80) { hurufNilai = "B"; } else if (nilai >= 55 && nilai <= 65) { hurufNilai = "C"; } else if (nilai >= 45 && nilai <= 55) { hurufNilai = "D"; } else { hurufNilai = "E"; } System.out.println("Nilai " + nilai + " dikonversi ke huruf " + hurufNilai); } }
Editor Settings
Theme
Key bindings
Full width
Lines