Академический Документы
Профессиональный Документы
Культура Документы
#include<conio.h>
#include<stdio.h>
#include<dos.h>
#include<iomanip>
#include<stdlib.h>
#include<string.h>
void showTime();
void showseats();
void movielist();
void booking();
void cancel();
void seatcategory();
void exit_();
int selection;
string cname;
int fi=1;
int numberseat;
int i,j,k,m=3,n=10,arr[100][100];
string holybood[30]={"IRONMAN","WHITE_HOSUE","KUNFU_HUSTLE"};
int input;
int flag;
int arr1[5];
int avail=30;
int seatnumber;
string name,mname;
int booking_ID=0;
int dd,mm,yy;
int mnum;
string moviename;
int cost=0;
char print;
void ticket();
void numseat();
void movielist()
int i ;
for(i=0;i<3;i++)
cout<<"\n\t\t"<<"("<<i+1<<")."<<holybood[i];
cout<<"\n\n";
cin>>mnum;
switch(mnum)
case 1:
showTime();
booking();
break;
case 2:
booking();
break;
case 3:
showTime();
booking();
break;
default:
goto h;
void showTime()
cout<<"\n\t\t\t1.morningshow ";
cin>>input;
if(input==1)
showseats();
seatcategory();
}
else if(input==2)
showseats();
seatcategory();
else if(input==3)
showseats();
seatcategory();
else{
goto o;
void showseats()
string str[20]={"DIAMOND","GOLD","SILVER"};
string str1[30]={"PRICE FOR DIAMOND SCREEN 200 RS/-","PRICE FOR GOLD SCREEN 180 RS/-
","PRICE FOR SILVER SCREEN 160 RS/-"};
cout<<"\n"<<setw(90)<<"=============SCREEN=============="<<endl;
int p=0;
do
cout<<"\n"<<setw(70)<<"*************"<<str[p]<<"*************"<<endl;
cout<<"\n"<<setw(90)<<str1[p]<<endl;
cout<<"\n"<<setw(90)<<"================================="<<endl;
cout<<"\n\n";
k=1;
for(i=0;i<3;i++)
for(j=0;j<n;j++)
arr[i][j]=k;
if(k<=9)
cout<<setw(10)<<"avail-"<<"0"<<setw(1)<<arr[i][j]<<" ";
if(k>=10)
cout<<setw(10)<<"avail-"<<setw(2)<<arr[i][j]<<" ";
k++;
cout<<"\n";
p++;
cout<<"\n";
}while(p<3);
return ;
}
//category of seat function
void seatcategory()
char sc;
cout<<"\n\t\t\t for diamond press [d]:"<<"\n\t\t\t for gold press [g] "<<"\n\t\t\t for silve
press [s]"<<endl;
cin>>sc;
if(sc=='d')
numseat();
cost+=numberseat*200;
else if(sc=='g')
numseat();
cost+=numberseat*160;
else if(sc=='s')
cost+=numberseat*160;
else
void numseat()
cin>>numberseat;
if(numberseat>4)
cout<<"\n\t\t\t\t\t SORRY! you can't book more than four seats \n";
goto r;
//booking function
void booking()
{
l:cout<<"\n\t\t\t ENTER THE SEAT NUMBER(S): ";
for(i=0;i<numberseat;i++)
cin>>arr1[i];
for(i=0;i<1;i++)
for(j=0;j<1;j++)
if(arr1[i]<=avail&&arr[i][j]<=avail&&fi==1)
cin>>name;
ticket();
booking_ID++;
avail--;
break;
else
if(avail<=0)
cout<<"\n";
cout<<"\t\t\t SORRY, the show is fully booked\n";
cout<<"\t\t\t=================END=================\n\n";
return;
// ticket function
void ticket()
char option;
cin>>option;
if(option=='y')
cout<<"\n\t\t\t"<<"***********************************************************
*******";
cout<<"\n\t\t\t"<<"***********************************************************
*******";
cout<<"\n";
cout<<"\n\t\t\t"<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||";
cout<<"\n\t\t\t"<<" ";
for(i=0;i<numberseat;i++){
cout<<arr1[i];
}
if(mnum==1)
cout<<setw(1)<<"IRONMAN";
else if(mnum==2)
cout<<setw(1)<<"white house";
else
cout<<setw(1)<<"kunfu hustle";
if(input==1)
else if(input==2)
cout<<"first show(2:45pm-6pm)";
else
cout<<"second show(9pm-11pm)";
cout<<"\n\t\t\t"<<" ";
cout<<"\n\t\t\t"<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||";
cout<<"\n\t\t\t"<<"***********************************************************
*******";
cin>>print;
cout<<"\n\t\t\t"<<"PRINTING.....";
for(int t=0;t<100000;t++)
cout<<"\n\t\t\t"<<"PRINTED"<<endl;
}
//cancel function
void cancel()
cin>>cname;
if(cname.compare(name)==0)
flag=1;
else
cout<<"\n\t\t\t this customer does not exist please enter valid name : ";
flag=0;
if(flag==1)
for(i=numberseat;i>=0;i--)
arr1[i-1]=arr1[i];
arr1[i]=0;
cout<<"\n\t\t\t"<<"************************************"<<"\n";
cout<<"\n\t\t\t"<<"************************************"<<"\n";
if(flag==0)
goto h;
}
//exit function
void exit_()
exit(1);
return;
int main(void)
// displaymenu();
while(1)
cout<<"\n\t\t"<<"==========================="<<endl;
cout<<"\n\t\t"<<"MENU"<<endl;
cout<<"\n\t\t"<<"====================="<<endl;
cout<<"\n\t\t"<<"(2). CANCEL"<<endl;
cout<<"\n\t\t"<<"(3). EXIT"<<endl;
cin>>selection;
switch(selection)
case 1:
movielist();
break;
case 2:
cancel();
break;
case 3:
exit_();
break;
default:
goto b;