Percobaan percabangan if-else
public static void main(String[] args) {
int point;
point=3;
System.out.println("===================");
System.out.println("Nama : heru.firmansyah");
System.out.println("Point :"+ point);
if(point >= 3)
System.out.println(" Ket : dapat medali EMAS");
else if (point >= 2)
System.out.println("Ket : dapat medali PERAK");
else if (point >= 1)
System.out.println("Ket : dapat medali PERUNGGU");
else
System.out.println("Ket : tidak dapat medali");
System.out.println("===========================");
}
// TODO code application logic here
}
public static void main(String[] args) {
int point;
point=3;
System.out.println("===================");
System.out.println("Nama : heru.firmansyah");
System.out.println("Point :"+ point);
if(point >= 3)
System.out.println(" Ket : dapat medali EMAS");
else if (point >= 2)
System.out.println("Ket : dapat medali PERAK");
else if (point >= 1)
System.out.println("Ket : dapat medali PERUNGGU");
else
System.out.println("Ket : tidak dapat medali");
System.out.println("===========================");
}
// TODO code application logic here
}
Tidak ada komentar:
Posting Komentar