SHARE
TWEET

Untitled

a guest Apr 26th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Rumah;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class Utama {
  8.  
  9.     public static void main(String[] args) throws IOException {
  10.     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  11.    
  12.     //Istance of class
  13.     DalamanRumah DalamanRumahA = new DalamanRumah("", "");
  14.     DalamanRumah DalamanRumahB = new DalamanRumah("", "", "", "");
  15.    
  16.     //menu
  17.     while (true) {
  18.        
  19.         System.out.println("==========================================");
  20.         System.out.println("           LIST DALAMAN RUMAH             ");
  21.         System.out.println("==========================================");
  22.         System.out.println("1. Input Dalaman Rumah A");
  23.         System.out.println("2. Input Dalaman Rumah B");
  24.         System.out.println("3. Lihat Isi Dalaman Rumah");
  25.         System.out.println("4. Keluar");
  26.         System.out.println("==========================================");
  27.        
  28.         //input
  29.         System.out.println("Masukkan Pilihan = ");
  30.         int pilih = Integer.parseInt(br.readLine());
  31.        
  32.         System.out.println();
  33.        
  34.         // proses + output
  35.         switch (pilih) {
  36.         case 1:
  37.             System.out.println("=====================================");
  38.             System.out.println("INPUT DALAMAN RUMAH A");
  39.             System.out.println("=====================================");
  40.             System.out.println("Masukkan No Rumah = ");
  41.             String NoRumah = br.readLine();
  42.             System.out.println("Masukan Alamat = ");
  43.             String Alamat = br.readLine();
  44.            
  45.             DalamanRumahA = new DalamanRumah(NoRumah, Alamat);
  46.             System.out.println();
  47.             System.out.println(" ### Data Dalaman Rumah A Telah disimpan ###");
  48.            
  49.         case 2:
  50.            
  51.             System.out.println("=====================================");
  52.             System.out.println("INPUT DALAMAN RUMAH B");
  53.             System.out.println("=====================================");
  54.             System.out.println("Masukan No Rumah = ");
  55.             String NoRumah1 = br.readLine();
  56.             System.out.println("Masukan Alamat = ");
  57.             String Alamat1 = br.readLine();
  58.             System.out.println("Masukan Ruangan = ");
  59.             String DalamanRumah = br.readLine();
  60.             System.out.println("Masukan Perabotan = ");
  61.             String Perabotan = br.readLine();
  62.            
  63.             DalamanRumahB = new DalamanRumah(NoRumah1, Alamat1, DalamanRumah, Perabotan);
  64.             System.out.println();
  65.             System.out.println(" ### Data Dalaman Rumah B Telah disimpan ###");
  66.             break;
  67.            
  68.         case 3:
  69.             System.out.println("======================================");
  70.             System.out.println("ISI DALAMAN RUMAH");
  71.             System.out.println("======================================");
  72.            
  73.             System.out.println("Dalaman Rumah A");
  74.             System.out.println("No Rumah A = " + DalamanRumahA.getNoRumah());
  75.             System.out.println("Alamat Rumah A = "+ DalamanRumahA.getAlamat());
  76.             System.out.println("Ruangan A = "+ DalamanRumahA.Ruangan());
  77.             System.out.println("Perabotan A = "+ DalamanRumahA.Perabotan());
  78.            
  79.             System.out.println();
  80.            
  81.             System.out.println("Dalaman Rumah B");
  82.             System.out.println("No Rumah B = " + DalamanRumahB.getNoRumah());
  83.             System.out.println("Alamat Rumah B = "+ DalamanRumahB.getAlamat());
  84.             System.out.println("Ruangan B = "+ DalamanRumahB.Ruangan());
  85.             System.out.println("Perabotan B = "+ DalamanRumahB.Perabotan());
  86.            
  87.             System.out.println("========================================");
  88.  
  89.         }
  90. }
  91.     }
  92. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top