Source Code:
import java.io.*;class kamar
{
public static void main (String [] args) throws Exception
{
String [][] tkamar = new String [4][2];
String [][] dkamar = new String [5][3];
BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
do
{
System.out.println("----------------");
System.out.println("Hotel Melati jaya");
System.out.println("----------------");
System.out.println("1. Input Kamar");
System.out.println("2. Search Kamar");
System.out.println("3. Keluar");
System.out.println("----------------");
System.out.print("Masukkan Pilihan :");
int pil = Integer.parseInt(br.readLine());
if (pil == 1)
{
System.out.println("Inputan Data");
System.out.println("----------------");
System.out.println("1. Input Type Kamar");
System.out.println("2. Input Detail Kamar");
System.out.println("----------------");
System.out.print("Masukkan Pilihan :");
int pi = Integer.parseInt(br.readLine());
if (pi==1)
{
for (int i=0; i<4;i++)
{
System.out.print("Tipe Kamar :");
tkamar [i][0] = br.readLine();
System.out.print("Harga Kamar :");
tkamar [i][1] = br.readLine();
}
}
else if (pi==2)
{
for (int i=0; i<5;i++)
{
System.out.print("Nama Kamar :");
dkamar [i][0] = br.readLine();
System.out.print("Tipe Kamar :");
dkamar [i][1] = br.readLine();
System.out.println("");
for (int f=0;f<4;f++)
{
if (dkamar [i][1].equalsIgnoreCase(tkamar[f][0]))
{
System.out.println("Harga Kamar :"+tkamar[f][1]);
dkamar[i][2] = tkamar[f][1];
break;
}
}
}
}
}
else if (pil==2)
{
System.out.print("Tipe Kamar :");
String tk = br.readLine();
for (int f=0;f<5;f++)
{
if (tk.equalsIgnoreCase(dkamar[f][1]))
{
System.out.println("Nama Kamar :"+dkamar[f][0]);
System.out.println("Type Kamar :"+dkamar[f][1]);
System.out.println("Harga Kamar :"+dkamar[f][2]);
}
}
}
else if (pil==3)
{
break;
}
}
while(true);
}
}
Semoga bermanfaat, Salam berbagi... ;)
Aplikasi Hotel Java (JCreator)
Reviewed by Unknown
on
2/26/2016
Rating:
No comments: