Sabtu, 25 Mei 2013

CONTOH PROGRAM CONVERT NILAI MENJADI KOMENTAR DALAM BAHASA JAVA


CONTOH PROGRAM CONVERT NILAI MENJADI KOMENTAR DALAM BAHASA JAVA
PROGRAMNY :
import java.util.Scanner;
class fungsi_switch
{  //yogi.king.pratama@blogspot.com
public static void main (String [] args)
 {
Scanner input=new Scanner (System.in);
int nilai;
System.out.print("Masukkan nilai:");
nilai=input.nextInt();

switch(nilai)
{
case 10:
System.out.println("excellent");break;
case 9:
System.out.println("very very good");break;
case 8:
System.out.println("very good");break;
case 7:
System.out.println("good");break;
case 6:
System.out.println("cukup bagus");break;
case 5:
System.out.println("cukup");break;
case 4:
System.out.println("kurang");break;
case 3:
System.out.println("kurang sekali");break;
case 2:
System.out.println("hancur");break;
case 1:
System.out.println("di ujung tanduk");break;

default:
System.out.println("gak ada hahahaha");
}
}
}
HASIL OUTPUT :

Tidak ada komentar:

Posting Komentar