Program Tiket Konser
Dengan Menggunakan C++
#include <conio.h>
#include <iostream.h>
main()
{
char kodekon,kodejen,jenis[23],nama[23],judul[23],ulang;
int jumbel,tothar,totbay,ukem,ubay,harga;
float disc;
atas:
cout<<"\t\t**********************************\n";
cout<<"\t\t\tMUSTICA MUSICAL\n";
cout<<"\t\t Penjualan Tiket Konser\n";
cout<<"\t\t**********************************\n\n";
cout<<"Nama Pembeli\t\t\t:";
cin>>nama;
cout<<"Kode Konser[1/2/3]\t\t:";
cin>>kodekon;
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>>kodejen;
cout<<"Jumlah Beli\t\t\t:";
cin>>jumbel;
clrscr();
cout<<"\t\t**********************************\n";
cout<<"\t\t\tMUSTICA MUSICAL\n";
cout<<"\t\t Penjualan Tiket Konser\n";
cout<<"\t\t**********************************\n\n";
cout<<"Nama Pembeli\t\t\t:"<<nama<<endl;
if (kodekon=='1')
{
strcpy(judul,"Java Jazz Festival");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=75000;
}
else if (kodejen=='c')
{ strcpy(jenis,"VVIP");
harga=10000;
}}
else if (kodekon=='2')
{
strcpy(judul,"Young Diva In Concert");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=100000;
}
else if (kodejen=='c')
{ strcpy(jenis,"VVIP");
harga=15000;
}}
else if (kodekon=='3')
{
strcpy(judul,"L.A Light Indie Fest");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=90000;
}
else if (kodejen=='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:"<<jumbel<<endl;
cout<<"========================================\n";
tothar=harga*jumbel;
cout<<"Total Harga\t\t\t:"<<tothar<<endl;
if(jumbel>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();
}
Hasil.:
#include <iostream.h>
main()
{
char kodekon,kodejen,jenis[23],nama[23],judul[23],ulang;
int jumbel,tothar,totbay,ukem,ubay,harga;
float disc;
atas:
cout<<"\t\t**********************************\n";
cout<<"\t\t\tMUSTICA MUSICAL\n";
cout<<"\t\t Penjualan Tiket Konser\n";
cout<<"\t\t**********************************\n\n";
cout<<"Nama Pembeli\t\t\t:";
cin>>nama;
cout<<"Kode Konser[1/2/3]\t\t:";
cin>>kodekon;
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>>kodejen;
cout<<"Jumlah Beli\t\t\t:";
cin>>jumbel;
clrscr();
cout<<"\t\t**********************************\n";
cout<<"\t\t\tMUSTICA MUSICAL\n";
cout<<"\t\t Penjualan Tiket Konser\n";
cout<<"\t\t**********************************\n\n";
cout<<"Nama Pembeli\t\t\t:"<<nama<<endl;
if (kodekon=='1')
{
strcpy(judul,"Java Jazz Festival");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=75000;
}
else if (kodejen=='c')
{ strcpy(jenis,"VVIP");
harga=10000;
}}
else if (kodekon=='2')
{
strcpy(judul,"Young Diva In Concert");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=100000;
}
else if (kodejen=='c')
{ strcpy(jenis,"VVIP");
harga=15000;
}}
else if (kodekon=='3')
{
strcpy(judul,"L.A Light Indie Fest");
if (kodejen=='a')
{ strcpy(jenis,"Tribune");
harga=50000;
}
else if (kodejen=='b')
{ strcpy(jenis,"VIP");
harga=90000;
}
else if (kodejen=='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:"<<jumbel<<endl;
cout<<"========================================\n";
tothar=harga*jumbel;
cout<<"Total Harga\t\t\t:"<<tothar<<endl;
if(jumbel>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();
}
Hasil.:
tampilan 1...
tampilan 2
semoga bermanfaat...!!!!!!!!!!!!!1
Tidak ada komentar:
Posting Komentar