diff --git a/Bubble.java b/Bubble.java new file mode 100644 index 0000000..c4115fd --- /dev/null +++ b/Bubble.java @@ -0,0 +1,28 @@ +//import java.util.Scanner; + +public class Bubble { + + public static void main(String[] args){ + + int[] arr = new int[10]; + int tmp = 0; + for (int i=0; iarr[j]){ + tmp = arr[i]; + arr[i] = arr[j]; + arr[j] = tmp; + }; + }; + }; + + for (int i=0; i80) { + System.out.println("A"); + } else if (score>60) { + System.out.println("B"); + } else if (score>40) { + System.out.println("C"); + } else if (score>20) { + System.out.println("D"); + } else { + System.out.println("E"); + } + } +} \ No newline at end of file diff --git a/SwitchBulan.java b/SwitchBulan.java new file mode 100644 index 0000000..5393449 --- /dev/null +++ b/SwitchBulan.java @@ -0,0 +1,53 @@ +import java.util.Scanner; + +public class SwitchBulan { + public static void main(String[] args){ + + int num = Integer.parseInt(args[0]); + + Scanner in = new Scanner(System.in); + + String bulan = "tes"; + + switch (num){ + case 1 : + bulan = "Januari"; + break; + case 2 : + bulan = "Februari"; + break; + case 3 : + bulan = "Maret"; + break; + case 4 : + bulan = "April"; + break; + case 5 : + bulan = "Mei"; + break; + case 6 : + bulan = "Juni"; + break; + case 7 : + bulan = "Juli"; + break; + case 8 : + bulan = "Agustus"; + break; + case 9 : + bulan = "September"; + break; + case 10 : + bulan = "Oktober"; + break; + case 11 : + bulan = "November"; + break; + case 12 : + bulan = "Desember"; + break; + } + + System.out.println(bulan); + } +} \ No newline at end of file