Tampilan Input :
Input Nama Pengunjung :
[Input]
Input Jumlah Kamar
: [Input]
======================
Input Kode Kamar
:
[Input]
Input Lama Inap : [Input]
Input Asal Pengunjung
: [Input]
Tampilan
Output :
|
Nama Pengunjung : X[20]
Kode Kamar : X[20]
Jenis Kamar : X[30]
Lama Inap :
X[5]
Harga Inap : X[9]
Jumlah Harga
Inap :
X[9]
Asal Pengunjung :
X[20]
Potongan : X[9]
Total Harga
Inap :
X[9]
Diskon :
X[9]
Total Harga :
X[9]
Total Bayar :
X[9]
|
Ketentuan :
-
Perulangan
ditentukan dari jumlah Kamar
-
Jika Kode Kamar “KM001”, maka Jenis Kamar “VVIP”, harga =
750000
-
Jika Kode Kamar “KM002”, maka Jenis Kamar “VIP”, harga =
500000
-
Jika Kode Kamar “KM003”, maka Jenis Kamar “Melati”, harga
= 450000
-
Jika Kode Kamar “KM004”, maka Jenis Kamar “Duluxe”, harga
= 350000
-
Jumlah Harga Inap = Lama Inap * Harga Inap
-
Jika Asal Pengunjung
dari SUMBAR, JAMBI dan Riau, maka dapat Potongan 75000
-
Total Harga Inap= Jumlah Harga Inap - Potongan
-
Jika Lama Inap >5, maka Diskon 10% dari Jumlah Harga
Inap
-
Total Harga = Total Harga Inap - Diskon
-
Total Bayar = Total Harga + Total Bayar
SELAMAT
BEKERJA, SEMOGA SUKSES !!!
Scriep Jawaban Soal:
#include
#include
#include
#include
garis ()
{
cout<<"==============================="<
}
spsi ()
{
cout<<" "<
}
main ()
{
struct
{
char np,ap [20];
char kk [20];
long hi,jhi,p,thi,th,tb,jk,tbb;
float d;
char jnk[20];
int a,li;
char jkj [10];
}ugd ;
cout<<"Nama Pengunjung: ";
cin>>ugd.np;
cout<<"Jumlah Kamar: ";
cin>>ugd.jk;
for (ugd.a=1;ugd.a<=ugd.jk;ugd.a++)
{
cout<<"Kode Kamar: ";
cin>>ugd.kk;
cout<<"Lama Inap: ";
cin>>ugd.li;
cout<<"Asal Pengunjung: ";
cin>>ugd.ap;
if(strcmp(ugd.kk,"KM001")==0)
{
strcpy(ugd.jnk,"VVIP");
ugd.hi=750000;
}else
if(strcmp(ugd.kk,"KM002")==0)
{
strcpy(ugd.jnk,"VIP");
ugd.hi=500000;
}else
if(strcmp(ugd.kk,"KM003")==0)
{
strcpy(ugd.jnk,"Melati");
ugd.hi=450000;
}else
if(strcmp(ugd.kk,"KM004")==0)
{
strcpy(ugd.jnk,"Duluxe");
ugd.hi=350000;
}else
{
strcpy(ugd.jnk,"error");
ugd.hi=0;
}
ugd.jhi=ugd.li * ugd.hi;
if(strcmp(ugd.ap,"sumbar")==0)
{
ugd.p=75000;
}else
if(strcmp(ugd.ap,"jambi")==0)
{
ugd.p=75000;
}else
if(strcmp(ugd.ap,"riau")==0)
{
ugd.p=75000;
}else
{
ugd.p=0;
}
ugd.thi=ugd.jhi-ugd.p;
if (ugd.li >=5 )
{
ugd.d=0.10 * ugd.jhi;
} else
{
ugd.d=0;
}
ugd.th=ugd.thi-ugd.d;
ugd.tb=ugd.th;
spsi ();
cout<<"Nama Pengunjung : "<
cout<<"Kode Kamar: "<
cout<<"Jenis Kamar : "<
cout<<"Lama Inap : "<
cout<<"Harga Inap : "<
cout<<"Jumlah Harga Inap : "<
cout<<"Asal Pengunjung : "<
cout<<"Potongan : "<
cout<<"Total Harga Inap : "<
cout<<"Diskon : "<
cout<<"Total Harga : "<
cout<<"Total Bayar : "<
garis ();
spsi ();
}
getch ();
}
#include
#include
#include
garis ()
{
cout<<"==============================="<
}
spsi ()
{
cout<<" "<
}
main ()
{
struct
{
char np,ap [20];
char kk [20];
long hi,jhi,p,thi,th,tb,jk,tbb;
float d;
char jnk[20];
int a,li;
char jkj [10];
}ugd ;
cout<<"Nama Pengunjung: ";
cin>>ugd.np;
cout<<"Jumlah Kamar: ";
cin>>ugd.jk;
for (ugd.a=1;ugd.a<=ugd.jk;ugd.a++)
{
cout<<"Kode Kamar: ";
cin>>ugd.kk;
cout<<"Lama Inap: ";
cin>>ugd.li;
cout<<"Asal Pengunjung: ";
cin>>ugd.ap;
if(strcmp(ugd.kk,"KM001")==0)
{
strcpy(ugd.jnk,"VVIP");
ugd.hi=750000;
}else
if(strcmp(ugd.kk,"KM002")==0)
{
strcpy(ugd.jnk,"VIP");
ugd.hi=500000;
}else
if(strcmp(ugd.kk,"KM003")==0)
{
strcpy(ugd.jnk,"Melati");
ugd.hi=450000;
}else
if(strcmp(ugd.kk,"KM004")==0)
{
strcpy(ugd.jnk,"Duluxe");
ugd.hi=350000;
}else
{
strcpy(ugd.jnk,"error");
ugd.hi=0;
}
ugd.jhi=ugd.li * ugd.hi;
if(strcmp(ugd.ap,"sumbar")==0)
{
ugd.p=75000;
}else
if(strcmp(ugd.ap,"jambi")==0)
{
ugd.p=75000;
}else
if(strcmp(ugd.ap,"riau")==0)
{
ugd.p=75000;
}else
{
ugd.p=0;
}
ugd.thi=ugd.jhi-ugd.p;
if (ugd.li >=5 )
{
ugd.d=0.10 * ugd.jhi;
} else
{
ugd.d=0;
}
ugd.th=ugd.thi-ugd.d;
ugd.tb=ugd.th;
spsi ();
cout<<"Nama Pengunjung : "<
cout<<"Kode Kamar: "<
cout<<"Jenis Kamar : "<
cout<<"Lama Inap : "<
cout<<"Harga Inap : "<
cout<<"Jumlah Harga Inap : "<
cout<<"Asal Pengunjung : "<
cout<<"Potongan : "<
cout<<"Total Harga Inap : "<
cout<<"Diskon : "<
cout<<"Total Harga : "<
cout<<"Total Bayar : "<
garis ();
spsi ();
}
getch ();
}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40933491-1', 'afrizal-manda.blogspot.com');
ga('send', 'pageview');
Tidak ada komentar:
Posting Komentar
Moga Saya Bisa memberi Solusi Yang Bermanfaat
By.Admin