UTS Praktek C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>

void main()
{
clrscr();
char nama[25],alamat[100],jenis_kamar[20];
long harga,lama_menginap,no,biaya,harga_bersih,besar_diskon_kamar,besar_diskon_tambahan,total;
long diskon_kamar,diskon_tambahan;
cout<<“Masukkan nama Anda : “;gets(nama);
cout<<“Masukkan alamat Anda : “;gets(alamat);
cout<<“Masukkan lama menginap : “;cin>>lama_menginap;
cout<<“Selamat datang di Hotel KENCANA”<<endl;
cout<<“Disini tersedia beberapa jenis kamar antara lain : “<<endl;
cout<<“1.EKONOMI”<<endl;
cout<<“2.LUXURY”<<endl;
cout<<“3.VIP”<<endl;
cout<<“4.SWEET ROOM”<<endl;
cout<<“5.PENTHOUSE”<<endl;
cout<<“Silahkan memilih no urut jenis kamar : “;cin>>no;
switch (no)
{
case 1 :harga=300000;cout<<“Jenis Kamar : Ekonomi”<<endl;
break;
case 2 :harga=400000;diskon_kamar=5;cout<<“Jenis Kamar : Luxury”<<endl;
break;
case 3 :harga=500000;diskon_kamar=10;cout<<“Jenis Kamar : VIP”<<endl;
break;
case 4 :harga=600000;diskon_kamar=15;cout<<“Jenis Kamar : Sweet Room”<<endl;
break;
case 5 :harga=800000;diskon_kamar=20;cout<<“Jenis Kamar : Penthouse”<<endl;
break;
}
besar_diskon_kamar=(harga*diskon_kamar)/100;
harga_bersih=harga-besar_diskon_kamar;
biaya=lama_menginap*harga_bersih;
if (biaya>=600000)
diskon_tambahan=10;
else if (biaya>5000000)
diskon_tambahan=20;
besar_diskon_tambahan=(biaya*diskon_tambahan)/100;
total=biaya-besar_diskon_tambahan;
cout<<“Harga Kamar : “<<harga_bersih<<endl;
cout<<“Total Bayar : “<<total<<endl;
getch();
}

Komentar Disini

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s