Program Layanan Objek Wisata Menggunakan Bahasa Pemrograman C++
Program ini di buat Oleh Juni Kanasti Dewi Follow Instagram nya di @junikanastiTampilan program ini sendiri adalah menampilkan daftar-daftar pilihan objek wisata yang tersedia di suatu daerah dan daftar nama pemesan atau penyewaan kendaraan. Berikut Syntax program dan hasil layoutnya.
1. Syntax Program Layanan Objek Wisata
#include<iostream>
#include<conio.h>
#include<string.h>
#include<windows.h>
#include<time.h>
#include <stdio.h>
using namespace std;
void gotoxy ( int x, int y){
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
void delay(unsigned int msecond)
{
clock_t goal=msecond+clock();
while(goal>clock());
}
int main(int argc, char** argv) {
{ struct obw
{
int ip;
char np[50],tw[15],lp[20],jp[20],pkl[10],jw;
int pa,pb,pc,pd,pe,j,hm;
int ha,hb,hc,hd,he,d;
int ppn,jb,tb,b,k;
int kp1,pk,dp,lg,a,n;
};
int a=-1;
obw Ba[100];
char jawab, lagi, pass[6],pnp[20],pjp[10],ppkl[10];
int n, t , input, menu,ma,pkd,mn,m,kode,kd,biaya,tb,d,P,h;
int pip,plp,ptw;
char mad;
mad='y';
while (mad=='y')
{system("cls");
for(h=1;h<20;h++)
{
delay(120);
gotoxy(h-1,0);cout<<' ';
gotoxy(h,0);cout<<" SELAMAT DATANG DI PERJALANAN OBJEK WISATA ";
cout<<endl;
}
pk:
cout<<"========================================"<<endl;
cout<<"| LAYANAN OBJEK WISATA |"<<endl;
cout<<"|--------------------------------------|"<<endl;
cout<<"| 1. DAFTAR PILIHAN OBJEK WISATA |"<<endl;
cout<<"| 2. DAFTAR NAMA PEMESAN |"<<endl;
cout<<"================================"<<endl;
cout<<"Pilih Menu 1/2 : ";cin>>pkd;
switch (pkd)
{{
case 1 :
{system("cls");
cout<<"================================================"<<endl;
cout<<"| PILIHAN OBJEK WISATA |"<<endl;
cout<<"|----------------------------------------------|"<<endl;
cout<<"| 1. DAFTAR TUJUAN OBJEK WISATA |"<<endl;
cout<<"| 2. DAFTAR PEMESAN & PERENTALAN KENDARAAN |"<<endl;
cout<<"| 3. PEMBAYARAN |"<<endl;
cout<<"================================================"<<endl;
cout<<"Silahkan pilih menu [1/2] = ";cin>>kd;
{system("cls");
if (kd==1)
{
cout<<"======================================="<<endl;
cout<<"| TUJUAN OBJEK WISATA |"<<endl;
cout<<"|-------------------------------------|"<<endl;
cout<<"| 1. RIAU |"<<endl;
cout<<"| 2. SUMATRA BARAT |"<<endl;
cout<<"| 3. BALI |"<<endl;
cout<<"| 4. LOMBOK |"<<endl;
cout<<"| 5. YOGYAKARTA |"<<endl;
cout<<"| 3. JAWA TENGAH |"<<endl;
cout<<"======================================="<<endl;
cout<<"Silahkan pilih menu [1/2] = ";cin>>P;
system("cls");
if (P==1)
{
cout<<"======================================="<<endl;
cout<<"| DAFTAR OBJEK WISATA DI RIAU |"<<endl;
cout<<"======================================="<<endl;
cout<<"| 1. CANDI MUARA TAKUS |"<<endl;
cout<<"| 2. PACU JALUR |"<<endl;
cout<<"| 3. ISTANA SIAK |"<<endl;
cout<<"| 4. PANTAI RUPAT |"<<endl;
cout<<"| 5. MESJID RAYA SANAPELAN |"<<endl;
cout<<"|======================================"<<endl;
}
else if(P==2)
{
cout<<"========================================"<<endl;
cout<<"| DAFTAR OBJEK WISATA DI SUMATRA BARAT |"<<endl;
cout<<"---------------------------------------|"<<endl;
cout<<"| 1. BATU MALIN KUNDANG |"<<endl;
cout<<"| 2. PULAU PASUMPAHAN |"<<endl;
cout<<"| 3. TAMAN RAYA BUNG HATTA |"<<endl;
cout<<"| 4. JAM GADANG |"<<endl;
cout<<"| 5. LUBANG JEPANG |"<<endl;
cout<<"========================================";
}
else if(P==3)
{
cout<<"================================="<<endl;
cout<<"| DAFTAR OBJEK WISATA DI BALI |"<<endl;
cout<<"---------------------------------"<<endl;
cout<<"| 1. PANTAI KUTA |"<<endl;
cout<<"| 2. PULAU SANUR |"<<endl;
cout<<"| 3. CANDI DESA |"<<endl;
cout<<"| 4. ISTANA TAMPAKSIRING |"<<endl;
cout<<"| 5. NUSA DUA |"<<endl;
cout<<"==================================";
}
else if (P==4)
{
cout<<"======================================="<<endl;
cout<<"| DAFTAR OBJEK WISATA DI YOGYAKARTA |"<<endl;
cout<<"---------------------------------------"<<endl;
cout<<"| 1. CANDI PRAMBANAN |"<<endl;
cout<<"| 2. TAMAN SARI YOGYAKARTA |"<<endl;
cout<<"| 3. KRATON YOGYAKARTA |"<<endl;
cout<<"| 4. JALAN MALIOBORO |"<<endl;
cout<<"| 5. PURAWISATA |"<<endl;
cout<<"=======================================";
}
else if(P==5)
{
cout<<"======================================="<<endl;
cout<<"| DAFTAR OBJEK WISATA DI JAWA TENGAH |"<<endl;
cout<<"---------------------------------------"<<endl;
cout<<"| 1. MESJIS AGUNG |"<<endl;
cout<<"| 2. LAWANG SEWU |"<<endl;
cout<<"| 3. RAWA PENING |"<<endl;
cout<<"| 4. AIR TERJUN SONGGO LANGIT |"<<endl;
cout<<"| 5. AIR TERJUN LAWE |"<<endl;
cout<<"=======================================";
}
if (kd==2) {{system("cls");
kp1:
a++;
cout<<"=========================="<<endl;
cout<<"| PENGGUNAAN KENDARAAN |"<<endl;
cout<<"-----------------------------"<<endl;
cout<<"| Kode | Jenis KENDARAAN |"<<endl;
cout<<"-----------------------------"<<endl;
cout<<"| 1 | KIJANG |"<<endl;
cout<<"| 2 | AVANZA |"<<endl;
cout<<"| 3 | AYLA |"<<endl;
cout<<"=============================";
}
system("cls");
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMESAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cin>>Ba[a].np;
cout<<"Tujuan wisata : ";cin>>Ba[a].tw;
cout<<"Penggunaan kendaraan : ";cin>>Ba[a].pkl;
cout<<"Lama penggunaan : ";cin>>Ba[a].lp;
cout<<"Pembayaran : ";cin>>Ba[a].jp;
cout<<"=================================="; }
cout<<"Apakah ada penyewaan lagi ? (y/t) : ";cin>>lagi;
if (lagi=='y' || lagi=='Y')
{
goto kp1;
}
else if (lagi=='t' || lagi=='T')
{
goto pk;
}
else
{
cout<<"Kode yg anda masukkan salah";
goto pk;
} }
}
if (kd==3) {
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMBAYARAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cin>>pnp;
cout<<"Tujuan wisata : ";cin>>ptw;
cout<<"Penggunaan kendaraan : ";cin>>ppkl;
cout<<"Lama Penggunaan jasa : ";cin>>plp;
cout<<"Jenis Pembayaran : ";cin>>pjp;
cout<<"=================================="<<endl;
system("cls");
if (plp < 4 ) {
biaya=200000;
d=0.02*biaya;
tb=biaya-d;
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMBAYARAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cout<<pnp<<endl;
cout<<"Tujuan Wisata : ";cout<<ptw<<endl;
cout<<"Lama Penggunaan jasa : ";cout<<plp<<endl;
cout<<"Penggunaan kendaraan : ";cout<<ppkl<<endl;
cout<<"Jenis Pembayaran : ";cout<<pjp<<endl;
cout<<"Biaya : ";cout<<biaya<<endl;
cout<<"Diskon : ";cout<<d<<endl;
cout<<"Total Bayar : ";cout<<tb<<endl;
cout<<"=================================="<<endl;
}
if (plp >= 6 && plp < 12 ) {
biaya=250000;
d=0.04*biaya;
tb=biaya-d;
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMBAYARAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cout<<pnp<<endl;
cout<<"Tujuan Wisata : ";cout<<ptw<<endl;
cout<<"Lama Penggunaan jasa : ";cout<<plp<<endl;
cout<<"Penggunaan kendaraan : ";cout<<ppkl<<endl;
cout<<"Jenis Pembayaran : ";cout<<pjp<<endl;
cout<<"Biaya : ";cout<<biaya<<endl;
cout<<"Diskon : ";cout<<d<<endl;
cout<<"Total Bayar : ";cout<<tb<<endl;
cout<<"=================================="<<endl;
}
if (plp >= 12 && plp < 24 ) {
biaya=300000;
d=0.05*biaya;
tb=biaya-d;
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMBAYARAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cout<<pnp<<endl;
cout<<"Tujuan Wisata : ";cout<<ptw<<endl;
cout<<"Penggunaan kendaraan : ";cout<<ppkl<<endl;
cout<<"Lama Penggunaan jasa : ";cout<<plp<<endl;
cout<<"Jenis Pembayaran : ";cout<<pjp<<endl;
cout<<"Biaya : ";cout<<biaya<<endl;
cout<<"Diskon : ";cout<<d<<endl;
cout<<"Total Bayar : ";cout<<tb<<endl;
cout<<"=================================="<<endl;
}
else {
biaya=200000;
d=0.1*biaya;
tb=biaya-d;
cout<<"=================================="<<endl;
cout<<"| DAFTAR PEMBAYARAN |"<<endl;
cout<<"----------------------------------"<<endl;
cout<<"Nama Pemesan : ";cout<<pnp<<endl;
cout<<"Tujuan Wisata : ";cout<<ptw<<endl;
cout<<"Penggunaan kendaraan : ";cout<<ppkl<<endl;
cout<<"Lama Penggunaan jasa : ";cout<<plp<<endl;
cout<<"Jenis Pembayaran : ";cout<<pjp<<endl;
cout<<"Biaya : ";cout<<biaya<<endl;
cout<<"Diskon : ";cout<<d<<endl;
cout<<"Total Bayar : ";cout<<tb<<endl;
cout<<"=================================="<<endl;
}
}
}
break;
case 2 :
{
system("cls");
cout<<"+===========================================+\n";
cout<<"| Daftar pemesan |\n";
cout<<"+===========================================+\n";
for (n=0;n<=a;n++) //pengulangan untuk mencari dan menampilkan data nasabah
{
cout<<"No. : "<<(n+1)<<endl;
cout<<"Nama Pemesana : "<<Ba[n].np<<endl;
cout<<"Tujuan wisata : "<<Ba[n].tw<<endl;
cout<<"Penggunaan kendaraan : "<<Ba[n].pkl<<endl;
cout<<"Lama Pengguaan jasa : "<<Ba[n].lp<<endl;
cout<<"Jenis Pembayaran : "<<Ba[n].jp<<endl;
cout<<"+===========================================+\n";
}
break;}
}
}
cout<<"Masih Ada Data(y/t)???";cin>>mad;
return 0;
}
}
}
2. Layout atau tampilan awal Program Layanan Objek Wisata
Menu Utama
Submenu Daftar pilihan Objek Wisata
Mungkin itu saja artikel tentang Membuat Program Layanan Objek Wisata Menggunakan Bahasa Pemrograman C dan C++ semoga bermanfaat dan menambah pengetahuan kamu.
(zac)
Baca Juga :
15 Contoh Program Sederhana Pemrograman C++
Membuat Program Bilangan Berurut Menggunakan Satu Looping 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