/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package praktikumpbo;
import javax.swing.JOptionPane;
/**
*
* @author AN
*/
public class soal3 {
public static void main(String []args){
String c=JOptionPane.showInputDialog("NILAI ANDA");
int d=Integer.parseInt(c);
if(d>79)
JOptionPane.showMessageDialog(null,"Nilai mu : "+"A");
else if(d>69)
JOptionPane.showMessageDialog(null,"Nilai mu : "+"B");
else if(d>55)
JOptionPane.showMessageDialog(null,"Nilai mu : "+"C");
else if(d>39)
JOptionPane.showMessageDialog(null,"Nilai mu : "+"D");
else
JOptionPane.showMessageDialog(null,"Nilai mu : "+"E");
}
}
Hasil
Berapa Nilai Ujian PBO Anda : (Misal jawabannya 70)
Maka hasilnya
Nilai Anda Adalah B
Ket :
Nilai
80 - 100 = A
70 - 79 = B
56 - 69 = C
40 - 55 = D
Kurang dari 40 = E