Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
2.5 kB
1
Indexable
Never
import java.util.Scanner;

class HelloWorld {
    public static void main(String[] args) {
        Scanner scan = new Scanner (System.in); 
        
        String status_lulus = "LULUS";
        String nilai_akademik = "";
        
        System.out.println("");
        System.out.println("");
        System.out.println("===================****==============");
        System.out.println("===================****==============");
        System.out.println("Informasi Aplikasi");
        System.out.println("Nilai Rentang > 85 Mendapatkan Nilai Akademik A");
        System.out.println("Nilai Rentang >= 76 Mendapatkan Nilai Akademik B");
        System.out.println("Nilai Rentang >= 60 Mendapatkan Nilai Akademik C");
        System.out.println("Nilai Rentang >=45 Mendapatkan Nilai Akademik D");
        System.out.println("Nilai Rentang < 45 Mendapatkan Nilai Akademik E");
        System.out.println("===================****==============");
        System.out.println("===================****==============");
        System.out.println("");
        System.out.println("");
        
        System.out.println("Input Penilaian Mahasiswa: ");
        System.out.println("Input NPM: ");
        String input_npm = scan.nextLine();
        System.out.println("Input NAMA: ");
        String input_nama = scan.nextLine();
        System.out.println("Input Mata Kuliah: ");
        String input_mata_kuliah = scan.nextLine();
        System.out.println("Input Nilai Mahasiswa: ");
        int input_nilai_mahasiswa = scan.nextInt();
        

        if(input_nilai_mahasiswa>85){
            nilai_akademik = "A";
        }else if(input_nilai_mahasiswa>=76){
            nilai_akademik = "B";
        }else if(input_nilai_mahasiswa>=60){
            nilai_akademik = "C";
        }else if(input_nilai_mahasiswa>=45){
            nilai_akademik = "D";
            status_lulus = "Tidak Lulus";
        }else{
            nilai_akademik = "E";
            status_lulus = "Tidak Lulus";
        }
        
        System.out.println("====================== ");
        System.out.println("====================== ");
        System.out.println("Nilai NPM ="+input_npm);
        System.out.println("Nama Mahasiswa = "+input_nama);
        System.out.println("Mata Kuliah = "+input_mata_kuliah);
        System.out.println("Nilai Mahasiswa = "+input_nilai_mahasiswa);
        System.out.println("Penilaian Akademik = "+nilai_akademik);
        System.out.println("Status Mahasiswa = "+status_lulus);
        

    }
}
Leave a Comment