RSS

Source Kode If, Else dan Switch

29 Nov

Statement If
int grade = 68;
if( grade > 60 ){
System.out.println(“Congratulations!”);
System.out.println(“You passed!”);
}
Statement Else
int grade = 68;
if( grade > 60 ){
System.out.println(“Congratulations!”);
System.out.println(“You passed!”);
}
Else
{
System.out.println(“Sorry you failed”);
}

Statement Switch
public class Grade
{
public static void main( String[] args )
{
int grade = 92;
switch(grade){
case 100:
System.out.println( “Excellent!” );
break;
case 90:
System.out.println(“Good job!” );
break;
case 80:
System.out.println(“Study harder!” );
break;
default:
System.out.println(“Sorry, you failed.”);
}
}
}

 
10 Komentar

Ditulis oleh pada 29 November 2008 in Uncategorized

 

10 responses to “Source Kode If, Else dan Switch

  1. Admin

    29 November 2008 at 07:11

    sabar sabar kotak komntnya hilang trzzzzzzzzzzzzzzzz

     
  2. Admin

    29 November 2008 at 07:20

    BBBBBTTTTTTTTTTTTTTT

     
  3. gozal

    29 November 2008 at 11:26

    bagus – bagus, kaya belajar deh!

     
  4. Armand

    29 November 2008 at 13:39

    Ilmu java nya manteeep nih sob!
    Ajarin donk!

    Armand

     
  5. lucy

    30 November 2008 at 07:53

    seneng ya blajar java?

    hmmmmm….

    tar dah jago ajarin ya,,.. ^_^

     
  6. Admin

    30 November 2008 at 10:11

    ko hilang lagi komentrnya

     
  7. Admin

    30 November 2008 at 10:30

    huhuuuu ko kotak komentarnya hilang trz

     
  8. Thoha

    1 Desember 2008 at 09:58

    kasih terus info tentang java ya..

     
  9. hesti

    1 Desember 2008 at 19:38

    wah….java euy….kayaknya jago ni….ajarin dunkZZZZ!!!

     
  10. syahroman

    28 Maret 2011 at 11:34

    di tnggu info yang lain nya,,,

     

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: