Kamis, 28 Juni 2012

Coding program menentukan hari

Sahabat pengetahuan21...ini saya share tentang coding program menentukan hari...
khusus yang mau coding ini boleh di copast..semoga bermanfaat ^-^


import java.util.Scanner;

public class FindDay {

public static void main(String[] args){
int bil;

Scanner in = new Scanner(System.in);

System.out.print("Masukkan urutan hari ");
bil = in.nextInt();

int d = bil;

switch(d) {
case 1: {
System.out.println("Senin");
break;
}
case 2: {
System.out.println("Selasa");
break;
}
case 3: {
System.out.println("Rabu");
break;
}
case 4: {
System.out.println("Kamis");
break;
}
case 5: {
System.out.println("Jum'at");
break;
}
case 6: {
System.out.println("Sabtu");
break;
}
case 7: {
System.out.println("Minggu");
break;
}

default: {
System.out.println("Bukan urutan hari");
break;
}
}
}

}

Don't forget Follow me on Twitter Ajiez

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Web Hosting Bluehost