Program Pemesaan Tiket Bioskop C++
#include
#include
#include
void menu();
void update(char jadwal[3][10]);
void jadwal(char baru[3][10]);
void login(char baru[3][10]);
void pesan1(int &ps);
void pesan2(int &ps);
void pesan3(int &ps);
void bayar(int jml,int &day,int jam);
void tiket(int plh,char baru[3][10],int kr[10],int ps,int day,int jam,int aa,int bb,int cc);
void metu(int i );
using namespace std;
main(){
menu();
return 0;
}
void menu()//layout
{
int mn;
char ch;
static char baru[3][10];
static int tk,plh,kr[10],dy,jam,aa,bb,cc;
cout<<"1.login 2.daftar film 3.pembayaran : "; cin>>mn;
if(mn==1)
{
login(baru);//layout
cout<<"ingin kembali ke menu utama y/t : ";cin>>ch;
system("cls");
if(ch=='Y' || ch=='y')
{
menu();
}
else
system("pause");
}
if(mn==2)
{
jadwal(baru);//layout
cout<<"masukan pilihan Film yang anda inginkan : "; cin>>plh;
cout<<"Masukan jam ";
cout<<"1. 12.00 2. 16.00 3.19.00 : ";cin>>jam;
if((jam==1) && (plh==1))
{
pesan1(tk);
}
else if((jam==2) && (plh==1))
{
pesan2(tk);
}
else if((jam==3) && (plh==1))
{
pesan3(tk);
}
if((jam==1) && (plh==2))
{
pesan1(tk);
}
else if((jam==2) && (plh==2))
{
pesan2(tk);
}
else if((jam==3) && (plh==2))
{
pesan3(tk);
}
if((jam==1) && (plh==3))
{
pesan1(tk);
}
else if((jam==2) && (plh==3))
{
pesan2(tk);
}
else if((jam==3) && (plh==3))
{
pesan3(tk);
}
else
cout<>ch;
system("cls");
if(ch=='Y' || ch=='y')
{
menu();
}
else
system("pause");
}
if(mn==3)
{
bayar(tk,dy,jam);
system("pause");
tiket(plh,baru,kr,tk,dy,jam,aa,bb,cc);
cout<<"ingin kembali ke menu utama y/t : ";cin>>ch;
system("cls");
if(ch=='Y' || ch=='y')
{
menu();
}
else
system("pause");
}
else
system("break");
}
void update(char jadwal[3][10])
{
int up;
cout<<"masukan jumlah update : "; cin>>up;
for(int i=1;i<=up;i++)
{
cout<<"masukan nama film : "; cin>>jadwal[i];
}
}
void jadwal(char baru[3][10])
{
cout<<"1."<>user;
if((user=="ardi")||(user=="adit")||(user=="asad")||(user=="arif")||(user=="galang")||(user=="bayu")||(user=="desi"))
{
cout<<"Password :";
ch = getch();
while(ch != 13)
{
pass.push_back(ch);
cout<< '*';
ch = getch();
}
if(pass=="admin")
{
cout<>ch;
system("cls");
if(ch=='Y' || ch=='y')
{
menu();
}
else
system("pause");
}
else
{
cout<0);
cout<<"Anda sudah 3 kali salah memasukan username dan password";
cout<>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan2(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemesan : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan3(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan4(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan5(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan6(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan7(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan8(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void pesan9(int &ps)
{
static int kr[10];
static char a,b,c,d,e,f,g,h,j;
cout<<"masukan jumlah pemsean : "; cin>>ps;
cout<<"| "<>kr[i];
if(kr[i]==1)
{
a='x';
}
else if (kr[i]==2)
{
b='x';
}
else if (kr[i]==3)
{
c='x';
}
else if (kr[i]==4)
{
d='x';
}
else if (kr[i]==5)
{
e='x';
}
else if (kr[i]==6)
{
f='x';
}
else if (kr[i]==7)
{
g='x';
}
else if (kr[i]==8)
{
h='x';
}
else if (kr[i]==9)
{
j='x';
}
else
system("pause");
}
}
void bayar(int jml,int &day,int jam)
{
static int hrg,bayar,uang,bali;
cout<<"----------------------------------\n";
cout<<"====| Harga Tiket |====\n";
cout<<"----------------------------------\n";
cout<<"1. Senin 5. Jumat\n";
cout<<"2. Selasa 6. Sabtu\n";
cout<<"3. Rabu 7. Minggu\n";
cout<<"4. Kamis\n\n";
cout<<"Masukan Hari : ";cin>>day;
if (day==1 || day==2|| day==3 || day==4 || day==5)
{
hrg=25000;
}
else if (day==6 || day==7)
{
hrg=35000;
}
else{
system("pause");
}
bayar=hrg*jml;
cout<<"\nTotal Pembayaran : "<>uang;
bali=uang-bayar;
cout<<"\nUang : "<
Share this :
0 Komentar
Penulisan markup di komentar