//PROGRAM 8-6 import java.io.*; interface Hari { int MINGGU = 1; int SENIN = 2; int SELASA = 3; int RABU = 4; int KAMIS = 5; int JUMAT = 6; int SABTU = 7; } class DemoVarInterface implements Hari { public static void main(String[] args) { String sInput = null; System.out.print("Masukkan nomor hari (1..7): "); InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); try { sInput = br.readLine(); int i = Integer.parseInt(sInput); String namaHari = null; switch (i) { case MINGGU : namaHari = "Minggu"; break; case SENIN : namaHari = "Senin"; break; case SELASA : namaHari = "Selasa"; break; case RABU : namaHari = "Rabu"; break; case KAMIS : namaHari = "Kamis"; break; case JUMAT : namaHari = "Jumat"; break; case SABTU : namaHari = "Sabtu"; break; } System.out.println("Hari ke-" + i + " adalah " + namaHari); } catch (IOException ioe) { ioe.printStackTrace(); } } }