/*Program Booking Hotel*/
#include<iostream>
#include<cstring>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main(){
char pengunjung[80], kodekamar, tipekamar, paketBonus[20], pesanKembali;
int lamaMenginap, hargasewa, total, bonusSouvenir, uangBayar, kembali;
atas:
cout<<"\t Hotel Mutis ";cout<<endl;
cout<<"\t Jl.Kaki 2.427 Meter diatas Permukaan Laut ";cout<<endl;
cout<<endl;
cout<<"Name Pengunjung : ";gets(pengunjung);
cout<<"Kode Kamar Hotel[S/L/P] : ";cin>>kodekamar;
cout<<"Lama Penginap : ";cin>>lamaMenginap;
cout<<endl;
cout<<"\t Information Of Order "<<endl;
cout<<" -----------------------------------------------------------------";cout<<endl;
cout<<endl;
cout<<"Tipe Kamar : "<<tipekamar;
switch(kodekamar)
{
case('s') :
case('S') :
{
cout<<"Standard Room"<<tipekamar;
hargasewa = 250000;
}
break;
case('l') :
case('L') :
{
cout<<"Large Room"<<tipekamar;
hargasewa = 350000;
}
break;
case('p') :
case('P') :
{
cout<<"Premium Room"<<tipekamar;
hargasewa = 450000;
}
break;
default:
cout<<endl;
cout<<"Kode Kamar Yang Anda Masukan Salah"<<endl;
//goto bawah;
if(lamaMenginap>=5)
{
strcpy(paketBonus,"Aksesories Handphone");
}
else
strcpy(paketBonus,"Tidak dapat Souvenir");
bonusSouvenir = 200000;
float sewa = lamaMenginap*hargasewa;
total = bonusSouvenir+sewa;
cout<<endl;
cout<<"Lama Menginap : "<<lamaMenginap;cout<<"Hari"<<endl;
cout<<"Bonus Souvenir : "<<paketBonus<<endl;
cout<<"Biaya Sewa Kamar :Rp. "<<sewa<< endl;
cout<<"Bonus Administrasi :Rp. "<<bonusSouvenir<<endl;
cout<<"Total Biaya :Rp. "<<total<<endl;
cout<<"=======================================";cout<<endl;
cout<<endl;
cout<<"Uang Bayar :Rp. "<<kembali<<endl;
// bawah:
cout<<endl;
cout<<"Pesan Lagi ?[Y/N] : ";cin>>pesanKembali;
if(pesanKembali =='y' || pesanKembali =='Y')
goto atas;
else
cout<<endl;
}
return 0;
}
No comments:
Post a Comment