Tiket Konser Coding ( TUGAS PRAKTEK BSI )


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

main()
{

char nama[20],kode_konser,jenis_tiket,jenis[23],judul[23],ulang;
int jumlah_beli,tothar,totbay,ukem,ubay,harga;
float disc;

atas:

cout<<"\t\t===================================\n";
cout<<"\t\t\tSELAMAT DATANG\n";
cout<<"\t\t\tBSI KONSER LAGI\n";
cout<<"\t\t     Penjualan Tiket Konser\n";
cout<<"\t\t===================================\n\n";
cout<<"Nama Pembeli\t\t: ";cin>>nama;
cout<<"Kode Konser[1/2/3]\t: ";cin>>kode_konser;
cout<<"jenis Tiket: \n";
cout<<"\ta.Tribune\n";
cout<<"\tb.VIP\n";
cout<<"\tc.VVIP\n\n";
cout<<"Pilih Jenis Tiket[a/b/c]: ";cin>>jenis_tiket;
cout<<"Jumlah Beli\t\t: ";cin>>jumlah_beli;

clrscr();
cout<<"\t\t**********************************\n";
cout<<"\t\t\tSelamat Datang\n";
cout<<"\t\t\tBSI KONSER LAGI\n";
cout<<"\t\t    Penjualan Tiket Konser\n";
cout<<"\t\t**********************************\n\n";
cout<<"Nama Pembeli\t\t\t: "<<nama<<endl;

if (kode_konser=='1')
{
strcpy(judul,"Ada");
                if (jenis_tiket=='A' || jenis_tiket=='a')
                {
   strcpy(jenis,"Tribune");
                harga=50000;
                }
                                else if (jenis_tiket=='B' || jenis_tiket=='b')
                                {
      strcpy(jenis,"VIP");
                                harga=75000;
                                }
   else if (jenis_tiket=='C' || jenis_tiket=='c')
   {
   strcpy(jenis,"VVIP");
   harga=10000;
   }
}


else if (kode_konser=='2')
{
strcpy(judul,"Bisa");
                if (jenis_tiket=='A' || jenis_tiket=='a')
                {
   strcpy(jenis,"Tribune");
                harga=50000;
                }
                                else if (jenis_tiket=='B' || jenis_tiket=='b')
                                {
      strcpy(jenis,"VIP");
                                harga=100000;
                                }
                else if (jenis_tiket=='C' || jenis_tiket=='c')
                {
   strcpy(jenis,"VVIP");
   harga=15000;
                }
}


else if (kode_konser=='3')
{
strcpy(judul,"Atau");
                if (jenis_tiket=='A' || jenis_tiket=='a')
                {
   strcpy(jenis,"Tribune");
                harga=50000;
                }
                                else if (jenis_tiket=='B' || jenis_tiket=='b')
                                {
      strcpy(jenis,"VIP");
                                harga=90000;
                                }

                else if (jenis_tiket=='C' || jenis_tiket=='c')
                {
   strcpy(jenis,"VVIP");
                harga=13000;
                }
}
else
{

cout<<"\n\nMAAF KODE YANG ANDA MASUKAN SALAH"<<endl<<endl;
cout<<"\n\n\n\n\n\t\t\t\t\tinput ulang [Y/T]?: ";cin>>ulang;
if(ulang=='Y'||ulang=='y')
goto atas;
else
goto bawah;
}

cout<<"Judul konser\t\t\t: "<<judul<<endl;
cout<<"Jenis tiket\t\t\t: "<<jenis<<endl;
cout<<"Harga tiket\t\t\t: "<<harga<<endl;
cout<<"Jumlah Beli\t\t\t: "<<jumlah_beli<<endl;
cout<<"========================================\n";
tothar=harga*jumlah_beli;
cout<<"Total Harga\t\t\t: "<<tothar<<endl;
if(jumlah_beli>5)
disc=0.05*tothar;
else
disc=0;
cout<<"Discount\t\t\t: "<<disc<<endl;
totbay=tothar-disc;
cout<<"Total Bayar\t\t\t: "<<totbay<<endl;
cout<<"Uang Bayar\t\t\t: ";
cin>>ubay;
ukem=ubay-totbay;
cout<<"Uang Kembali\t\t\t: "<<ukem<<endl;

cout<<"\n\n\n\n\n\t\t\t\t\tinput ulang [Y/T]?: ";cin>>ulang;
if(ulang=='Y'||ulang=='y')
goto atas;
else
goto bawah;

bawah:
clrscr();
cout<<"\t\t\t\t==================================\n\n";
cout<<"\t\t\t\t\tTERIMAKASIH\n\n";
cout<<"\t\t\t\t==================================\n\n";

getch();
}

No comments:

Post a Comment

Pages