Oke Langsung Saja Buka Editor Netbeans / Eclipse// Notepad ++ agan :
Ketikan Kode Berikut
// Package Import Library
Import Java.Io.BufferedReader;
Import Java.Io.InputStreamReader;
Import Java.Io.IOException;
//Constructor
BufferedReader masukan = new BufferedReader(new InputStreamReader(System.in));
String Nilai_1="",Nilai_2="",Nilai_3="";
int nilai_1,nilai_2,nilai_3,rata_hasil;
System.Out.Println("Input Nilai 1 : ");
try{
Nilai_1 = masukan.redLine();
catch(Exception e){
System.Out.Println(e);
}
nilai_1 = Integer.ParseInteger(Nilai_1);
System.Out.Println("Input Nilai 2 : ");
try{
Nilai_2 = masukan.redLine();
catch(Exception e){
System.Out.Println(e);
}
nilai_2 = Integer.ParseInteger(Nilai_2);
System.Out.Println("Input Nilai 3 : ");
try{
Nilai_3 = masukan.redLine();
catch(Exception e){
System.Out.Println(e);
}
nilai_3 = Integer.ParseInteger(Nilai_3);
rata_hasil = (nilai_1 + nilai_2 + nilai_3)/3;
System.Out.Println("Nilai Rata - Rata Anda : " rata_hasil);
if(rata_hasil >= 90 ){
System.Out.Println("Excelent");
}else if(rata_hasil >=80 && rata_hasil <90){
System.Out.Println("Good Job");
}else if(rata_hasil >=60 && rata_hasil < 80){
System.Out.Println("Kerja Keras");
}else{
System.Out.Println("Goblok");
}
Sekian Terima Kasih
0 komentar:
Posting Komentar