Monday, 25 November 2013

Contoh Program Switch

public class coba {
   public static void main(String[]args)
   {
       int grade = 80;
        switch(grade){
            case 100:
                System.out.println( "Cerdas!" );
            break;
            case 90:
                System.out.println("Kerja Bagus!" );
            break;
            case 80:
                System.out.println("Belajar rajin!" );
            break;
            default:
                System.out.println("maaf, kau gagal.");
        }}}

0 Komentar: