TauPintar.net - Di dalam program terdapat terdapat 2 (dua) pelayanan yang pertama tentang perhotelan/penginapandan yang kedua pelayanan Rumah Makan/cafe. Di dalam program menggunakan beberapa materi , Logika, Pernyataan, Looping, array serta beberapa preprocessor. Prepocesor iostream.h berfungsi untuk menjalankan cout dan cin, preprocessor conio.h di berfungsi untuk menjalankan clrscr() sertagotoxy (), string.h berfungsi untuk menjalankan strcpy ( ) , stdio.h berfungsi untuk menjalankan gets ( ), sedangkan time.h berfungsi untuk menjalankan tulisan berjalan.
Di dalam program ini pun menggunakan switch di mana switch ini berguna untuk pemilihan seperti ada dua pilihan maka harus masukan salah satu pemilihan tersebut, case yang terdapat pada switch minimal 2 karna bila cuma satu switch tidak berguna atau hanya menuhi program saja, menggunakan 2 case yang mana sudah di sebutkan di atas tadi bahwa memiliki 2 pelayanan, case yang pertama untuk pelayanan Hotel sedangkan case kedua untuk pelayanan Rumah Makan, tapi disini membuat 2 case di dalam case pertama.
Membuat Program Perhotelan dan Rumah Makan Menggunakan Bahasa Pemrograman C++
Program ini dibuat oleh Alfi Rizki Kunjungi juga blog nya Alfi AddressProgram pelayan hotel, disini dapat memilih dan memesan kamar yang di inginkan sedangkan di pelayanan Rumah Makan hanya dapat melihat dimana letak rumah makan/afé serta menu danharga, untuk lebih jelas nya lihat program di bawah ini.
1. Syntax Program
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
#include <time.h>
#include <string.h>
#include <stdio.h>
void delay(unsigned int mseconds)
{
clock_t goal=mseconds+clock();
while(goal>clock());
}
void main()
{
char mad;
mad='y';
while(mad=='y'||mad=='Y') // operator logika
{
clrscr();
int pilihan; // variabel pilihan layanan
clrscr();
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"| |"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
int h; //variabel tulisan berjalan header
for(h=1;h<25;h++)
{
delay(90);
gotoxy(h,2);cout<<" Selamat datang di Aplikasi Pelayanan";
gotoxy(0,2);cout<<" | ";
}
char nama[20],alamat[25],nohp[15]; // variabel nama,alamat,nohp
gotoxy(28,5);cout<<"Masukan Biodata Anda";
gotoxy(28,7);cout<<"Nama : ";gets(nama);
gotoxy(28,8);cout<<"Alamat : ";gets(alamat);
gotoxy(28,9);cout<<"No Hp : ";gets(nohp);
clrscr();
gotoxy(28,3);cout<<"1. Layanan Perhotelan"<<endl;
gotoxy(28,4);cout<<"2. Layana Cafe / Rumah Makan"<<endl;
gotoxy(28,7);cout<<"Masukan Pilihan Anda : ";cin>>pilihan;
switch(pilihan)
{
{
case 1:
{
char mad;
mad='y';
while(mad=='y'||mad=='Y')
{
int wil,nmh,tipkmr,tipe,pms; // variabel case 1
char hotel[20],tpkm[20],daerah[20],tphot[10];
long hrgkmr,tbayar;
clrscr();
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"| |"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
int h; //variabel tulisan berjalan header
for(h=1;h<18;h++)
{
delay(120);
gotoxy(h,2);cout<<" Selamat datang di Layanan Perhotelan/Penginapan";
gotoxy(0,2);cout<<" | ";
}
gotoxy(35,5);cout<<"Daftar Tipe Hotel "<<endl;
gotoxy(29,6);cout<<"---------------------------"<<endl;
gotoxy(29,7);cout<<"| No | Tipe Hotel |"<<endl;
gotoxy(29,8);cout<<"---------------------------"<<endl;
gotoxy(29,9);cout<<"| 1 | Bintang 5 |"<<endl;
gotoxy(29,10);cout<<"| 2 | Bintang 3 |"<<endl;
gotoxy(29,11);cout<<"| | |"<<endl;
gotoxy(29,12);cout<<"---------------------------"<<endl;
gotoxy(29,13);cout<<"Masukan tipe Hotel [1/2] : ";cin>>tipe;
clrscr();
switch(tipe)
{
{
case 1:
strcpy(tphot,"Bintang 5");
// 12345678901234567890123456789012345678901234567890123456789012345678901234567890
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"| Layanan Perhotelan/Penginapan |"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
//20 90123456789012345678901234
gotoxy(29,6);cout<<"--------------------------"<<endl;
gotoxy(29,7);cout<<"| No | Wilayah / Daerah |"<<endl;
gotoxy(29,8);cout<<"--------------------------"<<endl;
char dae[6][10]= {"A","Pekanbaru","Surabaya","Bandung","Jakarta","Medan"} ; //variabel Aray
int a; //variabel looping
for(a=1;a<=5;a++)
{
gotoxy(29,8+a);cout<<"|";
gotoxy(31,8+a);cout<<a;
gotoxy(34,8+a);cout<<"|";
gotoxy(37,8+a);cout<<dae[a];
gotoxy(54,8+a);cout<<"|";
}
// Aray
gotoxy(29,14);cout<<"--------------------------"<<endl;
gotoxy(29,15);cout<<"Masukan Daerah / Wilayah [1/2/3/4/5] : ";cin>>wil;
clrscr();
if(wil==1)
{
strcpy(daerah,"Pekanbaru");
// 10 234567890123456789012345678901234567890123456789012345678901234567
gotoxy(12,5);cout<<"------------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"------------------------------------------------------------------"<<endl;
char pek[4][20]={"a","Grand Jatra","Arya Duta","Labersa grand Hotel"} ; // variabel array dan ketentuannya
char alpek[4][30]={"b","Jl.Tengku Zainal Abidin No. 1","Jl.Diponegoro No. 34","Jl.Labersa Siak Hulu" }; // variabel array dan ketentuannya
int b; //variabel looping
for(b=1;b<=3;b++)
{
gotoxy(12,7+b);cout<<"|";
gotoxy(14,7+b);cout<<b;
gotoxy(17,7+b);cout<<"|";
gotoxy(19,7+b);cout<<pek[b];
gotoxy(42,7+b);cout<<"|";
gotoxy(44,7+b);cout<<alpek[b];
gotoxy(77,7+b);cout<<"|";
} // array
gotoxy(12,11);cout<<"------------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Grand Jatra");
gotoxy(32,2);cout<<" Hotel Grand Jatra"<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 400.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 200.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<"Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=400000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=200000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"Arya Duta");
gotoxy(32,2);cout<<" Hotel arya Duta "<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 620.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 400.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1) // hotel arya duta
{
strcpy(tpkm,"Vip");
hrgkmr=620000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=400000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Grand Labersa");
gotoxy(32,2);cout<<" Hotel Grand Labersa "<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip"); // hotel labersa
hrgkmr=500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=320000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==2)
{
strcpy(daerah,"Surabaya");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Majapahit | Jl.Tunjungan No.65 |"<<endl;
gotoxy(12,9);cout<<"| 2 | JW Mariot | Jl.Embong Malang No.85-89 |"<<endl;
gotoxy(12,10);cout<<"| 3 | Shangri-la | Jl.mayjend Sungkono No.120 |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Majapahit");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 700.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 560.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1) // hotel majapahit
{
strcpy(tpkm,"Vip");
hrgkmr=700000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=560000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"JW Mariot");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 800.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 650.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr; //surabaya
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=800000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=650000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Shangri-La");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 2.000.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 1.520.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{ //surabaya
strcpy(tpkm,"Vip");
hrgkmr=2000000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=1520000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==3)
{
strcpy(daerah,"Bandung");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Hilton | Jl.HOS Tjokroaminoto No.41-43 |"<<endl;
gotoxy(12,9);cout<<"| 2 | The Papandayan | Jl.Gatot Subroto No. 83 |"<<endl;
gotoxy(12,10);cout<<"| 3 | Padma | Jl.Ranca Bentang No.56-58 |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Hilton");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 1.000.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp.850.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr; //bandung
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=1000000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=850000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"The Papandayan");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 1.200.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 1.000.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl; //bandung
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=1200000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=1000000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Padma");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 1.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 1.320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{ //bandung
strcpy(tpkm,"Vip");
hrgkmr=1500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=1320000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==4)
{
strcpy(daerah,"Jakarta");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | The Sultan Hotel | Jl. Jend. Gatot Subroto |"<<endl;
gotoxy(12,9);cout<<"| 2 | The Park Lane | Jl. Casablanca Kav. 18 |"<<endl;
gotoxy(12,10);cout<<"| 3 | Mulia | Jl. Asia Afrika |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"The Sultan Hotel");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 4.000.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 3.000.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr; //jakarta
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=4000000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=3000000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"The Park Lane");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 6.200.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 5.700.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=6200000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=5700000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Mulia");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 5.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 4.320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=5500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=4320000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==5)
{
strcpy(daerah,"Medan");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Grand Swiss | Jl.S.Parman No.217 |"<<endl;
gotoxy(12,9);cout<<"| 2 | Arya Duta | Jl.Kapten maulan No. 8 |"<<endl;
gotoxy(12,10);cout<<"| 3 | JW Marriott | Jl.Putri Hijau No.10 |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Grand Swiss");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 4.000.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.000.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=4000000;
} //medan
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2000000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"Arya Duta");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 7.620.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 6.400.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=7620000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=6400000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"JW Marriott");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 3.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip"); // JW Marriott
hrgkmr=3500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2320000; //medan
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else
{
cout<<"Anda salah Masukan Kode"<<endl;
break;
}
gotoxy(31,11);cout<<" Jumlah Pemesanan : ";cin>>pms;
clrscr();
tbayar=pms*hrgkmr; // operator aritmatic
gotoxy(25,4);cout<<" Nama : "<<nama<<endl;
gotoxy(25,5);cout<<" Alamat : "<<alamat<<endl;
gotoxy(25,6);cout<<" No Hp : "<<nohp<<endl;
gotoxy(25,7);cout<<" Daerah : "<<daerah<<endl;
gotoxy(25,9);cout<<" Hotel : "<<hotel<<endl;
gotoxy(25,10);cout<<" Tipe Hotel : "<<tphot<<endl;
gotoxy(25,11);cout<<" Tipe kamar : "<<tpkm<<endl;
gotoxy(25,12);cout<<" Harga Kamar : "<<hrgkmr<<endl;
gotoxy(25,13);cout<<" Jumlah Pemesanan : "<<pms<<" kamar"<<endl;
gotoxy(25,14);cout<<" Total Bayar : "<<tbayar<<endl;
break;
}
//-----------------------------------case 2
case 2:
{
strcpy(tphot,"Bintang 3");
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"| Layanan Perhotelan/Penginapan |"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
gotoxy(28,5);cout<<"Daftar Daerah Hotel Bintang 3 "<<endl;
//20 90123456789012345678901234
gotoxy(29,6);cout<<"--------------------------"<<endl;
gotoxy(29,7);cout<<"| No | Wilayah / Daerah |"<<endl;
gotoxy(29,8);cout<<"--------------------------"<<endl;
// array
char dae[6][10]= {"A","Pekanbaru","Surabaya","Bandung","Jakarta","Medan"} ;
int a;
for(a=1;a<=5;a++)
{
gotoxy(29,8+a);cout<<"|";
gotoxy(31,8+a);cout<<a;
gotoxy(34,8+a);cout<<"|";
gotoxy(37,8+a);cout<<dae[a];
gotoxy(54,8+a);cout<<"|";
} //array
gotoxy(29,14);cout<<"--------------------------"<<endl;
gotoxy(29,15);cout<<"Masukan Daerah / Wilayah [1/2/3/4/5] : ";cin>>wil;
clrscr();
if(wil==1)
{
strcpy(daerah,"Pekanbaru");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Media hotel | Jl.Tambusai |"<<endl;
gotoxy(12,9);cout<<"| 2 | Jackport | Jl.Petani |"<<endl;
gotoxy(12,10);cout<<"| 3 | grand Hotel | Jl.Cendrawasi |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Media Hotel");
gotoxy(32,2);cout<<" Hotel Media Hotel"<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 300.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 150.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=300000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=150000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"Jackport");
gotoxy(32,2);cout<<" Hotel Jackport "<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 420.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 300.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1) // hotel jackport
{
strcpy(tpkm,"Vip");
hrgkmr=420000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=300000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Grand Hotel");
gotoxy(32,2);cout<<" Hotel Grand hotel "<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 430.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip"); // hotel grand
hrgkmr=430000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=320000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==2)
{
strcpy(daerah,"Surabaya");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Premium | Jl.Sanca Baru |"<<endl;
gotoxy(12,9);cout<<"| 2 | SX City | Jl.Kuningan |"<<endl;
gotoxy(12,10);cout<<"| 3 | Sheong | Jl.Melati |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Premium");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 360.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=360000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"SX City");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 570.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 400.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr; //surabaya
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=570000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=400000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Sheong");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 700.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 520.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{ //surabaya
strcpy(tpkm,"Vip");
hrgkmr=700000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=520000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==3)
{
strcpy(daerah,"Bandung");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Trans | Jl.Sudirman |"<<endl;
gotoxy(12,9);cout<<"| 2 | sejahtera | Jl.Gatot Subroto |"<<endl;
gotoxy(12,10);cout<<"| 3 | Dyr | Jl.Ranca Bentang |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Trans");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp.700.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp.550.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr; //bandung
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=700000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=550000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"Sejahtera");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 800.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 700.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl; //bandung
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=800000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=700000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Dyr");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 1.000.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 820.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{ //bandung
strcpy(tpkm,"Vip");
hrgkmr=1000000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=820000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==4)
{
strcpy(daerah,"Jakarta");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Malioboro | Jl. Malioboro |"<<endl;
gotoxy(12,9);cout<<"| 2 | The Lane | Jl. Casablanca |"<<endl;
gotoxy(12,10);cout<<"| 3 | Mutia | Jl. Asia Afrika |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Malioboro");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 2.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 1.900.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=2000000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=1900000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"The Lane");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 3.200.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.700.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=3200000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2700000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Mutia");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 3.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.320.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=3500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2320000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else if(wil==5)
{
strcpy(daerah,"Medan");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Hotel | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Grand | Jl.S.Parman |"<<endl;
gotoxy(12,9);cout<<"| 2 | Arya Duta | Jl.Kapten |"<<endl;
gotoxy(12,10);cout<<"| 3 | Selayar | Jl.Putri Hijau |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Hotel [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(hotel,"Grand");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 3.500.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.000.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=3500000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2000000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==2)
{
strcpy(hotel,"Arya Duta");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 5.620.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 3.400.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=5620000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=3400000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else if(nmh==3)
{
strcpy(hotel,"Selayar");
gotoxy(32,2);cout<<" Hotel "<<hotel<<endl;
gotoxy(26,4);cout<<" ---------------------------------"<<endl;
gotoxy(26,5);cout<<"| Tipe Kamar | Harga Permalam |"<<endl;
gotoxy(26,6);cout<<" ---------------------------------"<<endl;
gotoxy(26,7);cout<<"| 1. Vip | Rp. 3.570.000 |"<<endl;
gotoxy(26,8);cout<<"| 2. Biasa | Rp. 2.120.000 |"<<endl;
gotoxy(26,9);cout<<" ---------------------------------"<<endl;
gotoxy(26,10);cout<<" Pilih tipe kamar [1/2] : ";cin>>tipkmr;
if(tipkmr==1)
{
strcpy(tpkm,"Vip");
hrgkmr=3570000;
}
else if(tipkmr==2)
{
strcpy(tpkm,"Biasa");
hrgkmr=2120000;
}
else
{
strcpy(tpkm,"-");
hrgkmr=0;
}
}
else
{
cout<<"Input Dengan Benar !!! "<<endl;
break;
}
}
else
{
cout<<"Anda salah Masukan Kode"<<endl;
break;
}
gotoxy(32,11);cout<<" Jumlah Pemesanan : ";cin>>pms;
clrscr();
tbayar=pms*hrgkmr; // operator Arithmetic
gotoxy(25,8);cout<<" Daerah : "<<daerah<<endl;
gotoxy(25,9);cout<<" Hotel : "<<hotel<<endl;
gotoxy(25,10);cout<<" Tipe Hotel : "<<tphot<<endl;
gotoxy(25,11);cout<<" Tipe kamar : "<<tpkm<<endl;
gotoxy(25,12);cout<<" Harga Kamar : "<<hrgkmr<<endl;
gotoxy(25,13);cout<<" Jumlah Pemesanan : "<<pms<<" kamar"<<endl;
gotoxy(25,14);cout<<" Total Bayar : "<<tbayar<<endl;
break;
}
default:
cout<<"Maaf,Kode Yang Di Inputkan Salah"<<endl;
break;
}
cout<<endl<<endl;
gotoxy(26,17);cout<<"Masih ada data?[y/t] : ";cin>>mad;
clrscr();
int m; //variabel tulisan berjalan footer
for(m=1;m<15;m++)
{
delay(120);
gotoxy(m,10);cout<<" Terimakasih sudah menggunakan layanan kami dengan bijak";
}
}
break;
}
case 2: // case 2 pilihan layanan //-----------------------------case 2 pilihan
{
{
char mad;
mad='y';
while(mad=='y'||mad=='Y')
{
int wil,nmh;
char daerah[25],nama[25];
clrscr();
cout<<"-------------------------------------------------------------------------------"<<endl;
cout<<"| |"<<endl;
cout<<"-------------------------------------------------------------------------------"<<endl;
int m;
for(m=1;m<20;m++)
{
delay(90);
gotoxy(m,2);cout<<" Selamat Datang Di Layanan Rumah Makan/Cafe";
gotoxy(1,2);cout<<"|";
}
//----------------------------------------------------------------------------------------------
gotoxy(27,5);cout<<"Daftar Daerah Rumah Makan/Cafe"<<endl;
gotoxy(29,6);cout<<"--------------------------"<<endl;
gotoxy(29,7);cout<<"| No | Wilayah / Daerah |"<<endl;
gotoxy(29,8);cout<<"--------------------------"<<endl;
gotoxy(29,9);cout<<"| 1 | Pekanbaru |"<<endl;
gotoxy(29,10);cout<<"| 2 | Surabaya |"<<endl;
gotoxy(29,11);cout<<"--------------------------"<<endl;
gotoxy(23,15);cout<<"Masukan Daerah / Wilayah [1/2] : ";cin>>wil;
clrscr();
if(wil==1)
{
strcpy(daerah,"Pekanbaru");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Rm/Cafe | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Warkop 45 | Jl.Arifin ahmad |"<<endl;
gotoxy(12,9);cout<<"| 2 | Nasi Bakar | Jl.Subrantas |"<<endl;
gotoxy(12,10);cout<<"| 3 | Teraso | Jl.Purwodadi Ujung |"<<endl;
gotoxy(12,11);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Pilih Rumah Makan [1/2/3] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(nama,"Warkop 45");
gotoxy(35,2);cout<<nama<<endl;
gotoxy(0,4);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,5);cout<<"| Menu Makanan | Harga / Porsi | | Menu Minuman | Harga / Porsi |"<<endl;
gotoxy(0,6);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,7);cout<<"| 1. Nasi goreng | Rp. 20.000 | | 1. Caffe Late | Rp. 12.000 |"<<endl;
gotoxy(0,8);cout<<"| 2. Ayam Penyet | Rp. 35.000 | | 2. Caffe Luwak | Rp. 7.000 |"<<endl;
gotoxy(0,9);cout<<"| 3. Bebek Balado| Rp. 45.000 | | 3. Jus Melon | Rp. 8.000 |"<<endl;
gotoxy(0,10);cout<<"| 4. Gurame Bakar| Rp. 40.000 | | 4. Jus Lafukat | Rp. 8.000 |"<<endl;
gotoxy(0,11);cout<<"| 5. Iga bakar | Rp. 65.000 | | 5. Milk Shake | Rp. 10.000 |"<<endl;
gotoxy(0,12);cout<<"------------------------------------- -------------------------------------"<<endl;
gotoxy(15,14);cout<<" Untuk Pembelian Silahkan Kunjungi Toko Kami ";
}
else if(nmh==2)
{
strcpy(nama,"Nasi Bakar");
gotoxy(32,2);cout<<" Nasi Bakar "<<endl;
gotoxy(0,4);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,5);cout<<"| Menu Makanan | Harga / Porsi | | Menu Minuman | Harga / Porsi |"<<endl;
gotoxy(0,6);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,7);cout<<"| 1. Nasi Bakar | Rp. 20.000 | | 1. Teh Es | Rp. 3.000 |"<<endl;
gotoxy(0,8);cout<<"| 2. Ayam Penyet | Rp. 25.000 | | 2. Jus Jeruk | Rp. 8.000 |"<<endl;
gotoxy(0,9);cout<<"| 3. Nasi Uduk | Rp. 15.000 | | 3. Jus Melon | Rp. 8.000 |"<<endl;
gotoxy(0,10);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(26,12);cout<<" Pembelian Silahkan Kunjungi Toko Kami ";
}
else if(nmh==3)
{
strcpy(nama,"Teraso");
gotoxy(35,2);cout<<" Teraso "<<endl;
gotoxy(0,4);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,5);cout<<"| Menu Makanan | Harga / Porsi | | Menu Minuman | Harga / Porsi |"<<endl;
gotoxy(0,6);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,7);cout<<"| 1. Ayam Bakar | Rp. 20.000 | | 1. Teh Es | Rp. 3.000 |"<<endl;
gotoxy(0,8);cout<<"| 2. Ikan Bakar | Rp. 25.000 | | 2. Jus Jeruk | Rp. 8.000 |"<<endl;
gotoxy(0,9);cout<<"| 3. Ayam Pop | Rp. 15.000 | | 3. Jus alvokat | Rp. 8.000 |"<<endl;
gotoxy(0,10);cout<<"| 4. Rendang Ayam| Rp. 15.000 | -------------------------------------"<<endl;
gotoxy(0,11);cout<<"| 5. Gulai ayam | Rp. 15.000 |"<<endl;
gotoxy(0,12);cout<<" ------------------------------------"<<endl;
gotoxy(26,14);cout<<" Pembelian Silahkan Kunjungi Toko Kami ";
}
else
{
gotoxy(30,10);cout<<"Input dengan benar";
}
}
else if(wil==2)
{
strcpy(daerah,"Surabaya");
gotoxy(12,5);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,6);cout<<"| No | Nama Rumah Makan | alamat |"<<endl;
gotoxy(12,7);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,8);cout<<"| 1 | Rumah Makan Bersama | Jl.Tunjungan |"<<endl;
gotoxy(12,9);cout<<"| 2 | Cafe Jeger | Jl.Embong Malang |"<<endl;
gotoxy(12,10);cout<<"-------------------------------------------------------------"<<endl;
gotoxy(12,12);cout<<"Masukan Nama Rumah Makan [1/2] : ";cin>>nmh;
clrscr();
if(nmh==1)
{
strcpy(nama,"Rumah Makan Bersama");
gotoxy(32,2);cout<<" "<<nama<<endl;
gotoxy(0,4);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,5);cout<<"| Menu Makanan | Harga / Porsi | | Menu Minuman | Harga / Porsi |"<<endl;
gotoxy(0,6);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,7);cout<<"| 1. Ayam Bakar | Rp. 25.000 | | 1. Teh Es | Rp. 3.000 |"<<endl;
gotoxy(0,8);cout<<"| 2. Ikan Bakar | Rp. 15.000 | | 2. Jus Jeruk | Rp. 8.000 |"<<endl;
gotoxy(0,9);cout<<"| 3. Ayam Kecap | Rp. 10.000 | | 3. Es Timun | Rp. 8.000 |"<<endl;
gotoxy(0,10);cout<<"| 4. Rendang Sapi| Rp. 45.000 | | 4. Es Campur | Rp. 10.000 |"<<endl;
gotoxy(0,11);cout<<"------------------------------------- -------------------------------------"<<endl;
gotoxy(26,14);cout<<" Pembelian Silahkan Kunjungi Toko Kami ";
}
else if(nmh==2)
{
strcpy(nama,"Cafe Jeger");
gotoxy(32,2);cout<<" "<<nama<<endl;
gotoxy(0,4);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,5);cout<<"| Menu Makanan | Harga / Porsi | | Menu Minuman | Harga / Porsi |"<<endl;
gotoxy(0,6);cout<<" ------------------------------------ -------------------------------------"<<endl;
gotoxy(0,7);cout<<"| 1. Steak | Rp. 25.000 | | 1. Teh Es | Rp. 3.000 |"<<endl;
gotoxy(0,8);cout<<"| 2. Special Cup | Rp. 30.000 | | 2. Jus Jeruk | Rp. 8.000 |"<<endl;
gotoxy(0,9);cout<<"| 3. Sandwich | Rp. 20.000 | | 3. Es Timun | Rp. 8.000 |"<<endl;
gotoxy(0,10);cout<<"| 4. Burger jack | Rp. 20.000 | | 4. Es Campur | Rp. 10.000 |"<<endl;
gotoxy(0,11);cout<<"------------------------------------- -------------------------------------"<<endl;
gotoxy(26,14);cout<<" Pembelian Silahkan Kunjungi Toko Kami ";
}
else
{
gotoxy(30,10);cout<<"Masukan Kode Dengan Benar";
}
}
cout<<endl<<endl;
gotoxy(26,17);cout<<"Masih ada data Rm/Cafe?[y/t] : ";cin>>mad;
clrscr();
int h;
for(h=1;h<16;h++)
{
delay(120);
gotoxy(h,10);cout<<" Terimakasih Sudah Menggunkan Layanan Kami dengan Bijak";
gotoxy(15,11);cout<<" ------------------------------------------------------";
}
}
}}}}
cout<<endl<<endl;
gotoxy(26,17);cout<<"Masih ada data pelayanan?[y/t] : ";cin>>mad; // pertanyaan apa masih ada data pada case 2
clrscr();
int q; // variabel looping untuk di bawahnya
for(q=1;q<16;q++)
{
delay(120);
gotoxy(q,10);cout<<" Terimakasih Sudah Menggunkan Layanan Kami dengan Bijak";
gotoxy(15,11);cout<<" ------------------------------------------------------";
}
}}
2. Tampilan Awal Program
Note:
Program di atas dibuat menggunakan aplikasi Turbo c++
Program di atas sebisa mungkin dipahami setiap perintah-perintah syntaxnya supaya tidak kebingungan dan sesat dijalan. Sekian, Semoga bermanfaat, dan bisa menambah pengetahuan kamu.
(zac)
Baca Juga:
Membuat Program Counter HP Menggunakan Bahasa Pemrograman C++
Membuat Program Sistem Online Shop Menggunakan Bahasa Pemrograman C++
0 komentar:
Posting Komentar
Silahkan beri komentar dengan bijak dan sesuai dengan topik artikel.
Gunakan tombol balas dibawah komentar terkait jika ingin membalas komentar agar komunikasi lebih terstruktur.
Klik untuk melihat kode :) :( :s :D :-D ^:D ^o^ 7:( :Q :p T_T @-@ :-a :W *fck* :ngakak |o| :goodluck :smile