//Header Files
#include<iostream>
#include<fstream>
#include<conio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<process.h>
#include<time.h>
using namespace std;
//Class definitionfor ticket
class ticket{
public:
char name[10];
char cno[10];
} t; //object definitionfor ticket
// Class definitionfor card
class card : publicticket{ //inheritence for public ticket
public:
char address[50];
char emailid[20];
} v; //object definitionfor card
//Prototype Callfor the functions definitions.
void pay(int);
void random();
void card();
//Main function
int main(){
system("CLS");
//Integer Declaration
int ent, a, b, N, x, cardid;
char ans;
//To display the system time.
//Using time header file
{time_t t = time(NULL);
tm* timePtr = localtime(&t);
cout << "Time of the computer presently:";
cout << "seconds= " << timePtr->tm_sec << endl;
cout << "minutes = " << timePtr->tm_min << endl;
cout << "hours = " << timePtr->tm_hour << endl;
cout << "day of month = " << timePtr->tm_mday << endl;
cout << "month of year = " << timePtr->tm_mon << endl;
cout << "year = " << timePtr->tm_year + 1900 << endl;
cout << "weekday = " << timePtr->tm_wday << endl;
cout << "day of year = " << timePtr->tm_yday << endl;
cout << "daylightsavings = " << timePtr->tm_isdst << endl;
}
//An exit controlledloop (Do...While)
do{
//Menu
cout<<"nttt ----------------------------------";
cout<<"nttt Welcome to ASHV Cinemas ";
cout<<"nttt ----------------------------------";
cout<<"ntttt Welcome Customer!";
//Menu for the user
cout<<"nntttt <1> Movie Booking";
cout<<"ntttt <2> Recieving Ticket";
cout<<"ntttt <3> For Information";
cout<<"ntttt <4> GiftCard Registration";
cout<<"ntttt <5> Exit nn";
cout<<"ttttEnter Your Choice :"<<"t";
cin>>ent;
switch(ent)
{
//Movie Titles
case 1:
system("CLS");
cout<<"nnttttThe Shows are :";
cout<<"nntttt 1. petta";
cout<<"nntttt 2. 2.0";
cout<<"nntttt 3. mersal";
cout<<"nntttt 4. sarkar";
cout<<"nntttt 5. 24n";
cout<<"nttttEnter Your Choice :"<<"t";
cin>>a;
cout<<"nntttt The Timings for the selected
show are:";
switch(a)
{
case 1:
system("CLS");
cout<<"nntttt Select the the timings:
";
cout<<"ntttt 1. 0800";
cout<<"ntttt 2. 1300";
cout<<"ntttt 3. 1450";
cout<<"ntttt 4. 1800";
cout<<"ntttt 5. 2100";
cout<<"ntttt 6. 0100 n";
//Timings of the show
cout<<"nntttt Please select the
timings: ";
cin>>b;
cout<<"nntttt Enter your name:
";
cin>>t.name;
cout<<"nntttt Enter your contact
number: ";
cin>>t.cno;
cout<<"nntttt Enter the number
of tickets you want to purchase: ";
int x;
cin>>x;
pay(x);
cout<<"nnntttt Your ticket is
here: ";
cout<<"ntttt Name
:"<<t.name;
cout<<"ntttt Contact No :"<<t.cno;
cout<<"ntttt Show timings :";
switch(b)
{
case 1: cout<<"0800";
break;
case 2: cout<<"1300";
break;
case 3: cout<<"1450";
break;
case 4: cout<<"1800";
break;
case 5: cout<<"2100";
break;
case 6: cout<<"0100";
break;
}
cout<<"nntttt Do you want
to choose another option(y/n)";
cin>>ans;
system("CLS");
break;
case 2:
system("CLS");
cout<<"nnttttSelect the the timings:";
cout<<"ntttt 1. 0900";
cout<<"ntttt 2. 1100";
cout<<"ntttt 3. 1250";
cout<<"ntttt 4. 1500";
cout<<"ntttt 5. 2000";
cout<<"ntttt 6. 2200";
cout<<"ntttt Please select the
timings: ";
cin>>b;
cout<<"nntttt Enter your name:
";
cin>>t.name;
cout<<"ntttt Enter your contact
number: ";
cin>>t.cno;
cout<<"ntttt Enter the number of
tickets you want to purchase: ";
cin>>x;
pay(x);
cout<<"nntttt Your ticket is
here:";
cout<<"ntttt Name
:"<<t.name;
cout<<"ntttt Contact No :"<<t.cno;
cout<<"nttttShow timings :";
switch(b)
{
case 1: cout<<"0800";
break;
case 2: cout<<"1300";
break;
case 3: cout<<"1450";
break;
case 4: cout<<"1800";
break;
case 5: cout<<"2100";
break;
case 6: cout<<"0100";
break;
}
cout<<"nntttt Do you want to
choose another option(y/n)";
cin>>ans;
system("CLS");
break;
case 3:
system("CLS");
cout<<"nnttttSelect the the timings:";
cout<<"ntttt 1. 0800";
cout<<"ntttt 2. 1300";
cout<<"ntttt 3. 1450";
cout<<"ntttt 4. 1800";
cout<<"ntttt 5. 2100";
cout<<"ntttt 6. 0100";
cout<<"ntttt Please select the
timings";
cin>>b;
cout<<"ntttt Enter your name: ";
cin>>t.name;
cout<<"ntttt Enter your contact
number: ";
cin>>t.cno;
cout<<"nttttEnter the number of
tickets you want to purchase: ";
cin>>x;
pay(x);
cout<<"nntttt Your ticket is here:
";
cout<<"ntttt Name
:"<<t.name;
cout<<"ntttt Contact No :"<<t.cno;
cout<<"ntttt Show timings :";
switch(b)
{
case 1: cout<<"0900";
break;
case 2: cout<<"1300";
break;
case 3: cout<<"1450";
break;
case 4: cout<<"1800";
break;
case 5: cout<<"2100";
break;
case 6: cout<<"0100";
break;
}
cout<<"nntttt Do you want to
choose another option(y/n)";
cin>>ans;
system("CLS");
break;
case 4:
system("CLS");
cout<<"nnttttSelect the the timings: ";
cout<<"ntttt 1. 0800";
cout<<"ntttt 2. 1300";
cout<<"ntttt 3. 1450";
cout<<"ntttt 4. 1800";
cout<<"ntttt 5. 2100";
cout<<"ntttt 6. 0100";
cout<<"ntttt Please select the
timings: ";
cin>>b;
cout<<"ntttt Enter your name: ";
cin>>t.name;
cout<<"ntttt Enter your contact
number: ";
cin>>t.cno;
cout<<"ntttt Enter the number of
tickets you want to purchase: ";
cin>>x;
pay(x);
cout<<"nntttt Your ticket is here:
";
cout<<"ntttt Name
:"<<t.name;
cout<<"ntttt Contact No :"<<t.cno;
cout<<"ntttt Show timings :";
switch(b)
{
case 1: cout<<"0800";
break;
case 2: cout<<"1300";
break;
case 3: cout<<"1450";
break;
case 4: cout<<"1800";
break;
case 5: cout<<"2100";
break;
case 6: cout<<"0100";
break;
}
cout<<"nntttt Do you want
to choose another option(y/n)";
cin>>ans;
system("CLS");
break;
case 5:
system("CLS");
cout<<"nnttttSelect the the timings:";
cout<<"ntttt 1. 0800";
cout<<"ntttt 2. 1300";
cout<<"ntttt 3. 1450";
cout<<"ntttt 4. 1800";
cout<<"ntttt 5. 2100";
cout<<"ntttt 6. 0100";
cout<<"ntttt Please select the
timings: ";
cin>>b;
cout<<"ntttt Enter your name: ";
cin>>t.name;
cout<<"ntttt Enter your contact
number: ";
cin>>t.cno;
cout<<"ntttt Enter the number of
tickets you want to purchase: ";
cin>>x;
pay(x);
cout<<"n ntttt Your ticket is here:
";
cout<<"ntttt Name
:"<<t.name;
cout<<"ntttt Contact No :"<<t.cno;
cout<<"ntttt Show timings :";
switch(b)
{
case 1: cout<<"0800";
break;
case 2: cout<<"1300";
break;
case 3: cout<<"1450";
break;
case 4: cout<<"1800";
break;
case 5: cout<<"2100";
break;
case 6: cout<<"0100";
break;
}
cout<<"nntttt Do you want to
choose another option(y/n)";
cin>>ans;
system("CLS");
break;
}break;
case 2: system("CLS");
cout<<"nnThankyou for booking the
tickets online n To print out the tickets please enter your
transaction ID in the portal"; //Finding
about a prebooked ticket
struct pre
{
int trsnid;
char name[10];
} p;
cout<<"n Enter your transaction idn
(Eg.last five digits of the transactionid) ";
cin>>p.trsnid;
cout <<"Enter your name";
cin>>p.name;
cout<<"Sorry to say that but you will need
to get the print out of the bookingbecause our database shows
no bookingby this name";
cout<<"n Do you want to choose another
option(y/n)";
cin>>ans;
system("CLS");
break;
case 3: system("CLS");
cout<<"For further information about
movies you can downloadour Application(fromthe Google
Play Store or from the iOS App Store) or contact us at
01234567896523"; //Finding out more aboutour
cinemas
cout<<"n Do you want to choose another
option(y/n)";
cin>>ans;
system("CLS");
break;
case 4: system("CLS");
cout<<"Good Morning/Evneningn
Welcome to start a new journey with our cinemas n";
//card membership
card();
cout<<"Thankyou.n It will take us a week
for completing your registration for the card. n Please see the
benefits of the card on the next page. -->";
char f;
cout<<"n For selecting the page to go to
benefits say (y/n)n";
cin>>f;
if(f=='y')
{
cout<<"Thankyou for registeration
once again n The priveleges provided with this card are as
follows:";
cout<<"n 1. For every purchase of a
movie ticket you get 25 points(1point= 1Rs.) so after 16 movies
you get a free movie ticket.";
cout<<"n 2. You are providedwith
regular updatesregarding the movie and the showtimings.";
cout<<"n 3. Anytime prebook tickets
for the upcoming movie and preffered seats will be provided.";
}
cout<<"n Do you want to choose another
option(y/n)";
cin>>ans;
if(ans=='y')
{
system("CLS");
break;
}
else
{
exit(0);
}
break;
case 5:
system("CLS");
cout<<"nttttBrought To You by code-
projects.orgnntttt";
system("PAUSE");
exit(0);
break;
}
}while(ans=='y');
}
//Function Declaration for Card
void card()
{
int cardid;
cout<<"ttttWelcome to register for card facility in our
cinemas";
cout<<" ntttt Enter your name: ";
cin>>v.name;
cout<<"ttttEnter your mobile number: ";
cin>>v.cno;
cout<<"ttttEnter the address: ";
gets(v.address);
cout<<"ttttEnter the mail id: ";
gets(v.emailid);
system("CLS");
int ID;
srand (time(NULL));
ID = rand() % 400000 + 4000000;
if (ID<0)
ID=(ID*-1);
cout<<"ttttYour new card number is - :" <<"t"<<ID;
fstream fout;
fout.open("card.dat",ios::out|ios::app);
fout<<"n Name :"<<v.name<<"n"<<"nMobileNo.
:"<<v.cno<<"n"<<"nAddress :"<<v.address<<"n"<<"n Mail
ID :"<<v.emailid<<"n"<<"nCardNumber:"<<ID;
fout.close();
cout<<"ttttThank you for the registeration for the card.
n";
}
//Payment system for the interface
void pay(int a)
{
int normal, gold, amt[2],id;
time_t t = time(NULL);
//time setup
tm* timePtr = localtime(&t);
fstream fin;
fin.open("card.dat",ios::in|ios::app);
fin>>id;
cout<<"ttThankyou for selecting the show. Now we
request you to select your type of seating nntttt 1.Normal
Class ntttt OR ntttt 2. Gold Class";
int c;
cin>>c;
if(c==1)
{
cout<<"nnttttYou selected for a Normal show
nntttt";
system("PAUSE");
system("CLS");
amt[1] = a * 400;
char final;
cout<<"nntttt Do you have Giftcard(y/n): ";
cin>>final;
if(final=='y')
{
int cid;
fin.read((char*) &v, sizeof(v));
cout<<"nttttEnter the card number[10
digits]: ";
if(cid==id)
{
amt[1]=amt[1] - (0.1*amt[1]);
};
}
cout<<"nttttWant to pay by Card(y/n): ";
char rep;
cin>>rep;
cout<<"ntttt"<<"Paying :"<<amt[1]<<"n";
if (rep=='y'||rep=='Y')
{
cout<<"ttttName of the card holder: ";
char n[10];
gets(n);
cout<<"nttttEnter the card number: ";
char Card[16];
gets(Card);
cout<<"ttttExpiry(MM/YYYY)";
int expirymm,expiryyy;
cin>>expirymm;
cout<<"tttt/";
cin>>expiryyy;
while(expirymm<(timePtr->tm_mon) ||
expiryyy<(timePtr->tm_year + 1900)){
if(expirymm<=(timePtr->tm_mon))
{
cout<<"ttttEnter the month
again:";
cin>>expirymm;
}
if(expiryyy<(timePtr->tm_year + 1900))
{
cout<<"ttttPlease enter a valid
year: ";
cin>>expiryyy;
}
};
char password[3],vh;
int h;
puts("ttttEnter the CVV/CVV2:");
while (1)
{
if (h<0)
h=0;
vh=getch();
if (vh==13)
break;
if (vh==8)
{
putch(NULL);
putch(NULL);
putch(NULL);
h--;
continue;
}
password[h++]=vh;
vh='*';
putch(vh);
};
password[h]=='0';
}
}
else
{
cout<<"nnttttYou selected for the Gold Class
ntttt";
system("PAUSE");
system("CLS");
amt[2] = a * 700;
char final;
cout<<"nttttDo you have Giftcard(y/n): ";
cin>>final;
if(final=='y')
{
int cid;
cout<<"nttttEnter the card id number: ";
cin>>cid;
if(cid==id)
{
amt[1]=amt[1] - (0.1*amt[1]);
};
}
cout<<"nttttWant to pay by Card(y/n): ";
char rep;
cin>>rep;
cout<<"ntttt"<<"Paying :"<<amt[2]<<"n";
if (rep=='y'||rep=='Y')
{
cout<<"ttttName of the card holder: ";
char n[10];
gets(n);
cout<<"nttttEnter the card number: ";
char Card[16];
gets(Card);
cout<<"nttttExpiry(MM/YY): ";
int expirymm, expiryyy;
cin>>expirymm;
cout<<"n/";
cin>>expiryyy;
while(expirymm<(timePtr->tm_mon) ||
expiryyy<(timePtr->tm_year + 1900)){
if(expirymm<=(timePtr->tm_mon))
{
cout<<"nttttEnter the month
again:";
cin>>expirymm;
}
if(expiryyy<(timePtr->tm_year + 1900))
{
cout<<"nttttPlease enter a valid
year: ";
cin>>expiryyy;
}
};
char password[3],vh;
int h;
puts("nttttEnter the CVV/CVV2:");
while (1)
{
if (h<0)
h=0;
vh=getch();
if (vh==13)
break;
if (vh==8)
{
putch(NULL);
putch(NULL);
putch(NULL);
h--;
continue;
}
password[h++]=vh;
vh='*';
putch(vh);
};
password[h]=='0';
}
};
}

simple-movie-ticket-booking-system-1

  • 1.
  • 2.
    // Class definitionforcard class card : publicticket{ //inheritence for public ticket public: char address[50]; char emailid[20]; } v; //object definitionfor card //Prototype Callfor the functions definitions. void pay(int); void random(); void card(); //Main function int main(){ system("CLS"); //Integer Declaration int ent, a, b, N, x, cardid;
  • 3.
    char ans; //To displaythe system time. //Using time header file {time_t t = time(NULL); tm* timePtr = localtime(&t); cout << "Time of the computer presently:"; cout << "seconds= " << timePtr->tm_sec << endl; cout << "minutes = " << timePtr->tm_min << endl; cout << "hours = " << timePtr->tm_hour << endl; cout << "day of month = " << timePtr->tm_mday << endl; cout << "month of year = " << timePtr->tm_mon << endl; cout << "year = " << timePtr->tm_year + 1900 << endl; cout << "weekday = " << timePtr->tm_wday << endl; cout << "day of year = " << timePtr->tm_yday << endl; cout << "daylightsavings = " << timePtr->tm_isdst << endl; } //An exit controlledloop (Do...While)
  • 4.
    do{ //Menu cout<<"nttt ----------------------------------"; cout<<"nttt Welcometo ASHV Cinemas "; cout<<"nttt ----------------------------------"; cout<<"ntttt Welcome Customer!"; //Menu for the user cout<<"nntttt <1> Movie Booking"; cout<<"ntttt <2> Recieving Ticket"; cout<<"ntttt <3> For Information"; cout<<"ntttt <4> GiftCard Registration"; cout<<"ntttt <5> Exit nn"; cout<<"ttttEnter Your Choice :"<<"t"; cin>>ent; switch(ent) { //Movie Titles case 1:
  • 5.
    system("CLS"); cout<<"nnttttThe Shows are:"; cout<<"nntttt 1. petta"; cout<<"nntttt 2. 2.0"; cout<<"nntttt 3. mersal"; cout<<"nntttt 4. sarkar"; cout<<"nntttt 5. 24n"; cout<<"nttttEnter Your Choice :"<<"t"; cin>>a; cout<<"nntttt The Timings for the selected show are:"; switch(a) { case 1: system("CLS"); cout<<"nntttt Select the the timings: "; cout<<"ntttt 1. 0800"; cout<<"ntttt 2. 1300";
  • 6.
    cout<<"ntttt 3. 1450"; cout<<"ntttt4. 1800"; cout<<"ntttt 5. 2100"; cout<<"ntttt 6. 0100 n"; //Timings of the show cout<<"nntttt Please select the timings: "; cin>>b; cout<<"nntttt Enter your name: "; cin>>t.name; cout<<"nntttt Enter your contact number: "; cin>>t.cno; cout<<"nntttt Enter the number of tickets you want to purchase: "; int x; cin>>x; pay(x);
  • 7.
    cout<<"nnntttt Your ticketis here: "; cout<<"ntttt Name :"<<t.name; cout<<"ntttt Contact No :"<<t.cno; cout<<"ntttt Show timings :"; switch(b) { case 1: cout<<"0800"; break; case 2: cout<<"1300"; break; case 3: cout<<"1450"; break; case 4: cout<<"1800"; break; case 5: cout<<"2100"; break; case 6: cout<<"0100";
  • 8.
    break; } cout<<"nntttt Do youwant to choose another option(y/n)"; cin>>ans; system("CLS"); break; case 2: system("CLS"); cout<<"nnttttSelect the the timings:"; cout<<"ntttt 1. 0900"; cout<<"ntttt 2. 1100"; cout<<"ntttt 3. 1250"; cout<<"ntttt 4. 1500"; cout<<"ntttt 5. 2000"; cout<<"ntttt 6. 2200"; cout<<"ntttt Please select the timings: "; cin>>b;
  • 9.
    cout<<"nntttt Enter yourname: "; cin>>t.name; cout<<"ntttt Enter your contact number: "; cin>>t.cno; cout<<"ntttt Enter the number of tickets you want to purchase: "; cin>>x; pay(x); cout<<"nntttt Your ticket is here:"; cout<<"ntttt Name :"<<t.name; cout<<"ntttt Contact No :"<<t.cno; cout<<"nttttShow timings :"; switch(b) { case 1: cout<<"0800"; break;
  • 10.
    case 2: cout<<"1300"; break; case3: cout<<"1450"; break; case 4: cout<<"1800"; break; case 5: cout<<"2100"; break; case 6: cout<<"0100"; break; } cout<<"nntttt Do you want to choose another option(y/n)"; cin>>ans; system("CLS"); break; case 3: system("CLS"); cout<<"nnttttSelect the the timings:";
  • 11.
    cout<<"ntttt 1. 0800"; cout<<"ntttt2. 1300"; cout<<"ntttt 3. 1450"; cout<<"ntttt 4. 1800"; cout<<"ntttt 5. 2100"; cout<<"ntttt 6. 0100"; cout<<"ntttt Please select the timings"; cin>>b; cout<<"ntttt Enter your name: "; cin>>t.name; cout<<"ntttt Enter your contact number: "; cin>>t.cno; cout<<"nttttEnter the number of tickets you want to purchase: "; cin>>x; pay(x);
  • 12.
    cout<<"nntttt Your ticketis here: "; cout<<"ntttt Name :"<<t.name; cout<<"ntttt Contact No :"<<t.cno; cout<<"ntttt Show timings :"; switch(b) { case 1: cout<<"0900"; break; case 2: cout<<"1300"; break; case 3: cout<<"1450"; break; case 4: cout<<"1800"; break; case 5: cout<<"2100"; break; case 6: cout<<"0100";
  • 13.
    break; } cout<<"nntttt Do youwant to choose another option(y/n)"; cin>>ans; system("CLS"); break; case 4: system("CLS"); cout<<"nnttttSelect the the timings: "; cout<<"ntttt 1. 0800"; cout<<"ntttt 2. 1300"; cout<<"ntttt 3. 1450"; cout<<"ntttt 4. 1800"; cout<<"ntttt 5. 2100"; cout<<"ntttt 6. 0100"; cout<<"ntttt Please select the timings: "; cin>>b;
  • 14.
    cout<<"ntttt Enter yourname: "; cin>>t.name; cout<<"ntttt Enter your contact number: "; cin>>t.cno; cout<<"ntttt Enter the number of tickets you want to purchase: "; cin>>x; pay(x); cout<<"nntttt Your ticket is here: "; cout<<"ntttt Name :"<<t.name; cout<<"ntttt Contact No :"<<t.cno; cout<<"ntttt Show timings :"; switch(b) { case 1: cout<<"0800"; break;
  • 15.
    case 2: cout<<"1300"; break; case3: cout<<"1450"; break; case 4: cout<<"1800"; break; case 5: cout<<"2100"; break; case 6: cout<<"0100"; break; } cout<<"nntttt Do you want to choose another option(y/n)"; cin>>ans; system("CLS"); break; case 5: system("CLS"); cout<<"nnttttSelect the the timings:";
  • 16.
    cout<<"ntttt 1. 0800"; cout<<"ntttt2. 1300"; cout<<"ntttt 3. 1450"; cout<<"ntttt 4. 1800"; cout<<"ntttt 5. 2100"; cout<<"ntttt 6. 0100"; cout<<"ntttt Please select the timings: "; cin>>b; cout<<"ntttt Enter your name: "; cin>>t.name; cout<<"ntttt Enter your contact number: "; cin>>t.cno; cout<<"ntttt Enter the number of tickets you want to purchase: "; cin>>x; pay(x);
  • 17.
    cout<<"n ntttt Yourticket is here: "; cout<<"ntttt Name :"<<t.name; cout<<"ntttt Contact No :"<<t.cno; cout<<"ntttt Show timings :"; switch(b) { case 1: cout<<"0800"; break; case 2: cout<<"1300"; break; case 3: cout<<"1450"; break; case 4: cout<<"1800"; break; case 5: cout<<"2100"; break; case 6: cout<<"0100";
  • 18.
    break; } cout<<"nntttt Do youwant to choose another option(y/n)"; cin>>ans; system("CLS"); break; }break; case 2: system("CLS"); cout<<"nnThankyou for booking the tickets online n To print out the tickets please enter your transaction ID in the portal"; //Finding about a prebooked ticket struct pre { int trsnid; char name[10]; } p; cout<<"n Enter your transaction idn (Eg.last five digits of the transactionid) ";
  • 19.
    cin>>p.trsnid; cout <<"Enter yourname"; cin>>p.name; cout<<"Sorry to say that but you will need to get the print out of the bookingbecause our database shows no bookingby this name"; cout<<"n Do you want to choose another option(y/n)"; cin>>ans; system("CLS"); break; case 3: system("CLS"); cout<<"For further information about movies you can downloadour Application(fromthe Google Play Store or from the iOS App Store) or contact us at 01234567896523"; //Finding out more aboutour cinemas cout<<"n Do you want to choose another option(y/n)"; cin>>ans; system("CLS");
  • 20.
    break; case 4: system("CLS"); cout<<"GoodMorning/Evneningn Welcome to start a new journey with our cinemas n"; //card membership card(); cout<<"Thankyou.n It will take us a week for completing your registration for the card. n Please see the benefits of the card on the next page. -->"; char f; cout<<"n For selecting the page to go to benefits say (y/n)n"; cin>>f; if(f=='y') { cout<<"Thankyou for registeration once again n The priveleges provided with this card are as follows:";
  • 21.
    cout<<"n 1. Forevery purchase of a movie ticket you get 25 points(1point= 1Rs.) so after 16 movies you get a free movie ticket."; cout<<"n 2. You are providedwith regular updatesregarding the movie and the showtimings."; cout<<"n 3. Anytime prebook tickets for the upcoming movie and preffered seats will be provided."; } cout<<"n Do you want to choose another option(y/n)"; cin>>ans; if(ans=='y') { system("CLS"); break; } else { exit(0); }
  • 22.
    break; case 5: system("CLS"); cout<<"nttttBrought ToYou by code- projects.orgnntttt"; system("PAUSE"); exit(0); break; } }while(ans=='y'); } //Function Declaration for Card void card() { int cardid; cout<<"ttttWelcome to register for card facility in our cinemas"; cout<<" ntttt Enter your name: ";
  • 23.
    cin>>v.name; cout<<"ttttEnter your mobilenumber: "; cin>>v.cno; cout<<"ttttEnter the address: "; gets(v.address); cout<<"ttttEnter the mail id: "; gets(v.emailid); system("CLS"); int ID; srand (time(NULL)); ID = rand() % 400000 + 4000000; if (ID<0) ID=(ID*-1); cout<<"ttttYour new card number is - :" <<"t"<<ID; fstream fout; fout.open("card.dat",ios::out|ios::app); fout<<"n Name :"<<v.name<<"n"<<"nMobileNo. :"<<v.cno<<"n"<<"nAddress :"<<v.address<<"n"<<"n Mail ID :"<<v.emailid<<"n"<<"nCardNumber:"<<ID;
  • 24.
    fout.close(); cout<<"ttttThank you forthe registeration for the card. n"; } //Payment system for the interface void pay(int a) { int normal, gold, amt[2],id; time_t t = time(NULL); //time setup tm* timePtr = localtime(&t); fstream fin; fin.open("card.dat",ios::in|ios::app); fin>>id; cout<<"ttThankyou for selecting the show. Now we request you to select your type of seating nntttt 1.Normal Class ntttt OR ntttt 2. Gold Class"; int c;
  • 25.
    cin>>c; if(c==1) { cout<<"nnttttYou selected fora Normal show nntttt"; system("PAUSE"); system("CLS"); amt[1] = a * 400; char final; cout<<"nntttt Do you have Giftcard(y/n): "; cin>>final; if(final=='y') { int cid; fin.read((char*) &v, sizeof(v)); cout<<"nttttEnter the card number[10 digits]: ";
  • 26.
    if(cid==id) { amt[1]=amt[1] - (0.1*amt[1]); }; } cout<<"nttttWantto pay by Card(y/n): "; char rep; cin>>rep; cout<<"ntttt"<<"Paying :"<<amt[1]<<"n"; if (rep=='y'||rep=='Y') { cout<<"ttttName of the card holder: "; char n[10]; gets(n); cout<<"nttttEnter the card number: "; char Card[16]; gets(Card); cout<<"ttttExpiry(MM/YYYY)";
  • 27.
    int expirymm,expiryyy; cin>>expirymm; cout<<"tttt/"; cin>>expiryyy; while(expirymm<(timePtr->tm_mon) || expiryyy<(timePtr->tm_year+ 1900)){ if(expirymm<=(timePtr->tm_mon)) { cout<<"ttttEnter the month again:"; cin>>expirymm; } if(expiryyy<(timePtr->tm_year + 1900)) { cout<<"ttttPlease enter a valid year: "; cin>>expiryyy; } };
  • 28.
    char password[3],vh; int h; puts("ttttEnterthe CVV/CVV2:"); while (1) { if (h<0) h=0; vh=getch(); if (vh==13) break; if (vh==8) { putch(NULL); putch(NULL); putch(NULL); h--; continue; }
  • 29.
    password[h++]=vh; vh='*'; putch(vh); }; password[h]=='0'; } } else { cout<<"nnttttYou selected forthe Gold Class ntttt"; system("PAUSE"); system("CLS"); amt[2] = a * 700; char final; cout<<"nttttDo you have Giftcard(y/n): "; cin>>final; if(final=='y') {
  • 30.
    int cid; cout<<"nttttEnter thecard id number: "; cin>>cid; if(cid==id) { amt[1]=amt[1] - (0.1*amt[1]); }; } cout<<"nttttWant to pay by Card(y/n): "; char rep; cin>>rep; cout<<"ntttt"<<"Paying :"<<amt[2]<<"n"; if (rep=='y'||rep=='Y') { cout<<"ttttName of the card holder: "; char n[10]; gets(n); cout<<"nttttEnter the card number: ";
  • 31.
    char Card[16]; gets(Card); cout<<"nttttExpiry(MM/YY): "; intexpirymm, expiryyy; cin>>expirymm; cout<<"n/"; cin>>expiryyy; while(expirymm<(timePtr->tm_mon) || expiryyy<(timePtr->tm_year + 1900)){ if(expirymm<=(timePtr->tm_mon)) { cout<<"nttttEnter the month again:"; cin>>expirymm; } if(expiryyy<(timePtr->tm_year + 1900)) { cout<<"nttttPlease enter a valid year: ";
  • 32.
    cin>>expiryyy; } }; char password[3],vh; int h; puts("nttttEnterthe CVV/CVV2:"); while (1) { if (h<0) h=0; vh=getch(); if (vh==13) break; if (vh==8) { putch(NULL); putch(NULL); putch(NULL);
  • 33.