You are on page 1of 1

import javax.swing.

JOptionPane;
public class jarijari {
public static void main(String[] args){
int nama;
int b;
int c;
nama = Integer.parseInt(JOptionPane.showInputDialog("Pilih Nama
Mahasiswa :" +
"\n 1. Amir" +
"\n 2. Beny" +
"\n 3. Coky"));
String a = JOptionPane.showInputDialog("Total nilai SKS yang di
lulusi (max =48) :");
int jumlah = Integer.parseInt(a);
b = 12;
c = jumlah/b;
switch (nama)
{
case 1 : System.out.println("Total IPK maks = " + c);
JOptionPane.showMessageDialog(null,"Total IPK maks = " + c);brea
k;
case 2 : System.out.println("Total IPK maks = " + c);
JOptionPane.showMessageDialog(null,"Total IPK maks = " + c);brea
k;
case 3 : System.out.println("Total IPK maks = " + c);
JOptionPane.showMessageDialog(null,"Total IPK maks = " + c);brea
k;
default : System.out.println("Anda belum menginput");
JOptionPane.showMessageDialog(null,"Anda belum menginput");break
;
}
}
}

You might also like