Program untuk menghitung nilai IP mahasiswa
Program ini untuk menghitung nilai IPK mahasiswa berdasarkan jumlah sks yang di ambil
public class menghitungIP{
public static void main (String[] args) {
Scanner x = new Scanner(System.in);
System.out.print ("Jumlah SKS : ");
int JmlSks = x.nextInt();
System.out.print ("Jumlah Mata Kuliah : ");
int jmlMK = x.nextInt();
System.out.println ("");
double nilai=0;
double totNilai=0;
int totSKS2=0;
for(int i=0; i
System.out.print ("Nilai MK"+(i+1)+" :");
String nilaiMK = x.next();
if(nilaiMK.equals("A"))
nilai = 4;
else if (nilaiMK.equals("B+"))
nilai = 3.5;
else if (nilaiMK.equals("B"))
nilai = 3;
else if (nilaiMK.equals("C+"))
nilai = 2.5;
else if (nilaiMK.equals("C"))
nilai = 2;
else if (nilaiMK.equals("D+"))
nilai = 1.5;
else if (nilaiMK.equals("D"))
nilai = 1;
else if (nilaiMK.equals("E"))
nilai = 0;
else
System.out.println ("Nilai yang anda masukkan tidak ada");
System.out.print ("Jml SKS :");
int totSKS = x.nextInt();
totSKS2 = totSKS2+totSKS;
totNilai = totNilai+(nilai*totSKS);
System.out.println ("");
}
if(totSKS2
System.out.println ("Heeeh,,, SKS mu kurang tu....!! Cek Lagi...!!!");
else {
System.out.println ("");
System.out.println ("Jumlah Nilai : "+totNilai);
double IP = totNilai/JmlSks;
if (IP<2)
System.out.println ("Waduuuhhh... IP mu "+IP+" Bahaya tu!!!!");
else if(IP>=2 && IP<2.75)
System.out.println ("Hmmmm... IP mu "+IP+" Tingkatkan lagi!!!");
else if (IP>=2.75 && IP<3)
System.out.println ("Lumayan.... IP mu "+IP+" Tingkatkan Semester Depan!!!");
else if (IP>=3 && IP<3.5)
System.out.println ("Good,,, good,, IP mu "+IP+" Semester depan jangan sampai turun!!");
else if (IP>=3.5 && IP<4)
System.out.println ("Waaaaaaaw,,,, IP mu "+IP+" Nice job");
else if (IP==4)
System.out.println ("IP mu "+IP+" GAAA BISAAA COMEENTTT!!!");
else
System.out.println ("IP ga ada tuuh");
}
}
}
public static void main (String[] args) {
Scanner x = new Scanner(System.in);
System.out.print ("Jumlah SKS : ");
int JmlSks = x.nextInt();
System.out.print ("Jumlah Mata Kuliah : ");
int jmlMK = x.nextInt();
System.out.println ("");
double nilai=0;
double totNilai=0;
int totSKS2=0;
for(int i=0; i
System.out.print ("Nilai MK"+(i+1)+" :");
String nilaiMK = x.next();
if(nilaiMK.equals("A"))
nilai = 4;
else if (nilaiMK.equals("B+"))
nilai = 3.5;
else if (nilaiMK.equals("B"))
nilai = 3;
else if (nilaiMK.equals("C+"))
nilai = 2.5;
else if (nilaiMK.equals("C"))
nilai = 2;
else if (nilaiMK.equals("D+"))
nilai = 1.5;
else if (nilaiMK.equals("D"))
nilai = 1;
else if (nilaiMK.equals("E"))
nilai = 0;
else
System.out.println ("Nilai yang anda masukkan tidak ada");
System.out.print ("Jml SKS :");
int totSKS = x.nextInt();
totSKS2 = totSKS2+totSKS;
totNilai = totNilai+(nilai*totSKS);
System.out.println ("");
}
if(totSKS2
System.out.println ("Heeeh,,, SKS mu kurang tu....!! Cek Lagi...!!!");
else {
System.out.println ("");
System.out.println ("Jumlah Nilai : "+totNilai);
double IP = totNilai/JmlSks;
if (IP<2)
System.out.println ("Waduuuhhh... IP mu "+IP+" Bahaya tu!!!!");
else if(IP>=2 && IP<2.75)
System.out.println ("Hmmmm... IP mu "+IP+" Tingkatkan lagi!!!");
else if (IP>=2.75 && IP<3)
System.out.println ("Lumayan.... IP mu "+IP+" Tingkatkan Semester Depan!!!");
else if (IP>=3 && IP<3.5)
System.out.println ("Good,,, good,, IP mu "+IP+" Semester depan jangan sampai turun!!");
else if (IP>=3.5 && IP<4)
System.out.println ("Waaaaaaaw,,,, IP mu "+IP+" Nice job");
else if (IP==4)
System.out.println ("IP mu "+IP+" GAAA BISAAA COMEENTTT!!!");
else
System.out.println ("IP ga ada tuuh");
}
}
}
Tidak ada komentar:
Posting Komentar