SlideShare une entreprise Scribd logo
1  sur  58
C++ PROJECT 2012-2013 C++ PROJECT 2012-2013C++
PROJECT   C++ PROJECT         C++ PROJECT    C++ PROJECT
C++ PROJECT    C++ PROJECT        C++ PROJECT    C++
PROJECT   C++ PROJECT         C++ PROJECT    C++ PROJECT
C++ PROJECT    C++ PROJECT        C++ PROJECT    C++
PROJECT   C++ PROJECT         C++ PROJECT    C++ PROJECT
C++ PROJECT    C++ PROJECT        C++ PROJECT    C++
PROJECT
                 C++ PROJECT
          C++ PROJECT         C++ PROJECT    C++ PROJECT
C++ PROJECT        REPORT
               C++ PROJECT        C++ PROJECT    C++
PROJECT   C++ PROJECT 2012-2013
                              C++ PROJECT    C++ PROJECT
C++ PROJECT    C++ PROJECT        C++ PROJECT    C++
PROJECT   C++ PROJECT         C++ PROJECT    C++ PROJECT
            DONE BY :G RAJESH
C++ PROJECT    C++ PROJECT C++ PROJECT C++
                     12TH A
PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++
            KASTURBA ENGLISH MEDIUM SCHOOL ,
PROJECT C++MANJUMMEL C++ PROJECT C++ PROJECT C++
             PROJECT
PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++
PROJECT C++TOPIC:THEATRE MANAGEMENT C++ PROJECT C++
             PROJECT C++ PROJECT
PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT     1
C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT     1


C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
Movie
reservation




          2
                              KASTURBA

ENGLISH MEDIUM SENIOR SECONDARY SCHOOL
                Affiliated to CBSE, New Delhi, Aff. No. : 930463




                    Report on the Computer Project




Name             : G RAJESH

Standard         : XII Science

Project Guide    : Aravind Lakshman

Project          : MOVIE RESERVATION



     Certified that this is the bonafide report of the project
work of G Rajesh in this school submitted for the practical
examination held in 2013, Kasturba School, Manjummel.



Examiner                   Project Guide                           Principal




                                                                               3
                        KASTURBA

  ENGLISH MEDIUM SENIOR SECONDARY SCHOOL
            Affiliated to CBSE, New Delhi, Aff. No. : 930463




                Bonafide Certificate


     I certify that G Rajesh Student of Computer Science

studying in Std XII, Kasturba Senior Secondary School,

Manjummel has successfully completed the project

“MOVIE RESERVATION” under my guidance during the year

2012-2013




                                                       Project Guide




                                                                       4
   INDEX



 1.ACKNOWLEDGEMENT
 2.AIM
 3. APPARATUS
 4. FLOW CHART
 5. PROGRAM DESCRIPTION
 6. PROGRAM CODE
7. OUTPUT
8.BIBILIOGRAPHY




                           5
 ACKNOWLEDGEMENT




     I Would Like To Express My Deep Sense Of Gratitude To
    All Those Who Have Helped Me In Completing This Project.
           I Specially Thank Our Sir Aravind Lakshman Who
Gave Me All Guidance To Complete My Project Work Successfully.
            Apart From It, I Acknowledge My Parents, Group
members And All Others Who Helped Me For Completing This
Great Task.
              Above All I Thank The Almighty God For Making
This Project A Great Success.


   AIM
                                                               6
This is a program done in C++ language to reserve a movie ticket by users
from a list of movies which are managed by the administrator.
The user must provide his name and other details to book his/her desired
movie in the list.




    APPARATUS
                                                                           7
HARDWARE:-
     LOGITECH MOUSE
     LOGITECH KEYBOARD
     HP PRINTER
     INTEL DUAL CORE
     LCD MONITOR

SOFTWARE:-
   WINDOWS XP
   TURBO C++
   MS DOS
   MS WORD


 FLOW CHART
                          8
START

m1
             9
WELCOME SCREEN




             MAIN
             MENU
                                         ADMIN (‘A’)
                                         USER (‘U’)
       A
                    A



        If
                                 PASSWORD
     Choice==           TRUE     AND USERNAME   FALSE
                                                                    EXIT
     ’a’||’a’

                                                a1
                                      TRUE              TICKET INITIALISE(‘T’)

                                                        MOVIE LIST(‘A’)

                               ADMIN MENU               MODIFY MENU(‘M’

                                                        SETTINGS(‘S’)

                                                        BOOKING LIST(‘B’)

                                       ach              EXIT(‘E’)

                                                            BOOK(‘B’)

                                                            CANCEL(‘C’)

                                    USER MENU
If choice !=’U’                                                              10
&& !=’A’
TRUE

                                                      MODIFY(‘M’)

                                                      EXIT AS USER(‘E’)




   ELSE                                               EXIT(‘E’)

                                       mch            SWITCH(‘S’)




                       m2
   ach                                                     a1




                       TICKETS INITIALISE
If Choice==

 ’t’||’T’     TRUE                                    TC.TXT
               a3
                                                             a1


If Choice==             DISPLAY ALL MOVIE’S DETAILS

 ’a’||’A’     TRUE                                     MT.TXT




                 a2
                                                                      11
ADD MOVIES(‘A’)

                                                 EDIT MOVIES(‘E’)
If Choice==                         MODIFYING

 ’m’||’M’                            MENU
                      TRUE                       MODIFY MOVIES(‘M’)
                                                 EXIT MODIYING(‘E’)



              ach 2             READ CHOICE

                                                             a1


If Choice==                   BOOKING LIST

 ’b’||’B’              TRUE                              MB.TXT




If Choice==                    COLOUR SETTINGS     m1
 ’s’||’S’              TRUE




If Choice==
                                 m2
 ’e’||’E’             TRUE




                                  a1
   ELSE

  ach 2

                                                                      12
ADD MOVIES
if choice==
                                                       a3
  ‘a’||’A’      TRUE                   MT.TXT




If choice==            MODIFY MOVIE
                                                       a3
  ‘m’||’M’      TRUE                    MT.TXT




 If choice==

 ‘d’||’D’      TRUE     DELETE MOVIE
                                                       a3
                                         MT.TXT




 If choice==             a1
                TRUE
 ‘e’||’E’




                         a2
    ELSE

uch


               u1                                 13
If choice==
               TRUE   BOOK MOVIE
  ‘b’||’B’
                                              MB.TXT         u1

                        DETAILS



                                                             u1
                                               MB.TXT
 If choice==   TRUE   CANCEL BOOKING TRUE
  ‘c’||’C’                            FALSE   u1
                      TICKET NUMBER



                                                             u1
                                              MB.TXT
 If choice==
               TRUE   MODIFY BOOKING TRUE
 ‘m’||’M’
                                      FALSE   u1
                      TICKET NUMBER




If choice===   TRUE
                       m2
 ‘e’||’E’




  ELSE
                        u1




      mch

                                                        14
If choice===   TRUE    EXIT
                                EXIT
 ‘e’||’E’              SCREEN




If choice===            m1
                TRUE
 ‘s’||’S’




 PROGRAM
   DESCRIPTION
                                       15
This is a user friendly and menu driven
program which is designed to book tickets
for a movie by the user by providing the
necessary details.......

When the program is executed ,the welcome
screen appears showing the logo of the
theatre‟s name and then shows the option to
enter as an admin or a user.

The Admin menu is accessible only after
providing the right username and password
combination within 3 chances.

  The admin module has 6 options :
  Initialise tickets („T‟)
  Movies running („A‟)
  Modify movies („M‟)
                                            16
 Settings („S‟)
  See booking list („B‟)
  Exit as admin („E‟)

The “modify movies” option has a menu of
adding movies, deleting current movies and
editing the current movie details.

The option “settings” deals with customizing
the background colour and text colour.



The user menu has a simple menu containing
the options:

  Book a movie(„B‟)
  Modify a booking(„M‟)
  Cancel a booking(„B‟)
  Exit as user(„E‟)

When the “book a movie” option is selected
the list of all movies running in the theatre is
shown. The user has to select a movie and
then enter his/her details like name, age,
number of tickets to be booked and contact



                                               17
details. The total fare is calculated and is
shown along with the main ticket number.



The program is a very interactive and
interesting with colourful texts and coloured
background for each module making it very
close to real life booking of movie tickets as
on internet....




   PROGRAM CODE


                                                 18
/*

******
  T H E A T H T R E   M A N A G E M E N T   P R O J E C T    ******
 Done By:
 G Rajesh
 12th Science   2012-2013

Kasturba English Medium School
Manjummel */

#include<iostream.h>      //For Basic Input/output Operations
#include<fstream.h>       //For File Handling Operations
#include<conio.h>         //For getch() & clrscr() Functions
#include<dos.h>           //For delay() function
#include<stdio.h>         //For gets(),puts(),remove()& rename()..
#include<string.h>        //For strcmp() ,strcpy() Functions
#include<process.h>       //For Exit() Function
#include<time.h>          //For displaying time in user module
int mi=0;
int mj=10;
int ai=0;
int aj=11;
int ui=8;
int uj=9;
char ch,c1,c2,name[30]; //G L O B A L V A R I A B L E S
int i,p,p1,r;          // used throughout the program
long pos;
char aname[20],apass[20];
fstream fin,fout,file;         //G L O B A L F I L E P O I N T E R
S


                                                                 19
class admin              //Class Defined for Administration Module
{
public:
char mname[30];
void admn();
void result();
protected:
char mlang[20];
char mdes[50];
int mstars;
char mactors[30];
char mdirector[20];
float mprice;
char mcbfc[5];
char mtiming[20];
private:
void tcrun();
void edit();
void modify();
void del();
void add();
void settings();
public:
void seatmanage(int);
void amtcal(int);
int mseats;
int tick;
admin()                  // Constructor for class admin
{
strcpy(mname,"<no name>");
strcpy(mlang,"<no info>");
strcpy(mdes,"<no info>");
strcpy(mactors,"<no info>");
strcpy(mdirector,"<no info>");
strcpy(mcbfc,"n/a");
mstars=0;
tick=0;
mseats=0;
}
void showseats()
{
if(mseats>0)
cout<<mseats;
else
{
textcolor(0);cout<<"HOUSE FULL!!!";
}
}
}a;

class user:protected admin //Class for User Module Protectedly
Inherited from class Admin
{
private:
char uname[30];
int uage;

                                                                     20
int uno;
char uphone[20];
int utc;
char mov[30];
public:
void showbooked();
void tcallote();
void umenu();
void uedit();
void ucancel();
void ubooking();
user()
{
strcpy(uname,"empty ");
uage=0;
uno=0;
utc=0;
strcpy(uphone,"n/a");
}
protected:
}u;

void main()
{
clrscr();
int j,k;
gotoxy(24,19);
cout<<"L O A D I N G P R O J E C T F I L E "<<endl;
gotoxy(28,22);
cout<<"___________";
j=28;
for(int i=0;i<101;i++)
{
gotoxy(41,22);
delay(50);
cout<<i<<"% completed"<<endl;
if(i%10==0)
{
gotoxy(j,22);
j++;
cout<<char(16);
}
}
cout<<"nnttttSUCCESSFULLY LOADED" <<endl;
c1='s';
while(c1=='s'||c1=='S')
{
delay(500);
textbackground(mi);
textcolor(mj);
clrscr();
int i,x=1;
cout<<"╔";
delay(100);
for(i=0;i<78;i++)
{

                                                      21
delay(30);
gotoxy(2+i,1);cputs("═");
if(i<20)
{
gotoxy(1,i+2);cputs("║");
}
if(i==20)
{
gotoxy(1,22);cputs("╚");
}
if(i>20)
{
gotoxy(x+1,22);cputs("═");
x++;
}
}
delay(50);
gotoxy(80,1);cputs("╗");
for(i=0;i<22;i++)
{
delay(30);
if(i<20)
{
gotoxy(80,2+i);cputs("║");
}
gotoxy(x+i,22);cputs("═");
if(i==19)
{
gotoxy(80,22);cputs("╝") ;
}
}
delay(700);
textcolor(14);
gotoxy(2,2);
cputs("╔");
for(i=0;i<76;i++)
{
cputs("═");
}
for(i=3;i<21;i++)
{
gotoxy(2,i);cputs("║");
}
gotoxy(2,21);cputs("╚");
for(i=3;i<79;i++)
{
gotoxy(i,21);cputs("═");
}
cputs("╝") ;
for(i=20;i>2;i--)
{
gotoxy(79,i);cputs("║");
}
gotoxy(79,2);
cputs("╗");
delay(700);

                             22
textcolor(12);
gotoxy(3,3);
cputs("╔");
for(i=0;i<75;i++)
{
cputs("═");
}
for(i=4;i<21;i++)
{
gotoxy(3,i);
cputs("║");
}
gotoxy(3,20);
cputs("╚");
for(i=4;i<78;i++)
{
gotoxy(i,20);
cputs("═");
}
cputs("╝") ;
for(i=19;i>3;i--)
{
gotoxy(78,i);cputs("║");
}
gotoxy(78,3);
cputs("╗");
x=59;int y=10;
char c=char(15);
for(i=10;i<60;i++)
{
delay(50);
gotoxy(i,10);cout<<c;
gotoxy(i-1,10);cout<<" ";
}
for(i=0;i<6;i++)
{
delay(100);
gotoxy((x-i),(y-i));cout<<c;
gotoxy((x+i),(y+i));cout<<c;
gotoxy((x+i),(y-i));cout<<c;
gotoxy((x-i),(y+i));cout<<c;
}
int m=x+5,n=x-5;
for(i=0;i<40;i++)
{
delay(60);
if(i<13)
{
gotoxy(m+i,y+5);cout<<c;
gotoxy(m+i,y-5);cout<<c;
}
gotoxy((n-i),y+5);cout<<c;
gotoxy((n-i),y-5);cout<<c;
}
delay(200);
gotoxy(27,8);for(i=0;i<5;i++)cout<<c;

                                        23
gotoxy(27,9);cout<<" "<<c;
gotoxy(27,10);cout<<" "<<c;
gotoxy(27,11);cout<<" "<<c;
gotoxy(27,12);for(i=0;i<5;i++)cout<<c;
delay(200);
gotoxy(37,8);cout<<c<<"     "<<c;
gotoxy(37,9);cout<<c<<" "<<c<<" "<<c<<" "<<c;
gotoxy(37,10);cout<<c<<" "<<c<<" "<<c;
gotoxy(37,11);cout<<c<<"     "<<c;
gotoxy(37,12);cout<<c<<"     "<<c;
delay(200);
gotoxy(46,8); cout<<"    "<<c;
gotoxy(46,9); cout<<"   "<<c<<" "<<c;
gotoxy(46,10);cout<<" "<<c<<c<<c<<c<<c;
gotoxy(46,11);cout<<" "<<c<<"     "<<c;
gotoxy(46,12);cout<<c<<"       "<<c;
char temp[]={"IMAX::ENTERTAINMENT UNLIMITED"};
x=46;
c=char(2);
for(i=0;i<24;i++)
{
delay(100);
gotoxy(x-i,16);cout<<c<<temp<<c;
gotoxy((x-i+31),16);cout<<" ";
}
delay(40);gotoxy(31,17);cout<<"PHC-2,Banglore"<<endl;
delay(40);gotoxy(4,19);cout<<"www.etunlimited.com";
gotoxy(65,19);cout<<"Ph:080-623311"<<endl;
m=10;
y=47;
for(i=0;i<34;i++)
{
m++;
textcolor(m+8);
textbackground(0);
if(m==17)m=1;
if(i%2==0)
y--;
delay(90);
gotoxy(33,y); cputs(" PRESS ENTER ");
delay(100);
gotoxy(33,y+1);cputs("              ");
}
ch=getch();
if(ch!='r')
goto ex;
textcolor(5);
clrscr();
m=30,n=2,x=30,y=20;
char admins[]={"TO LOGIN AS ADMIN "A""};
char users[]={"TO ENTER AS USER "U""};
for(i=0;users[i]!='0';i++)
{
x++;
m++;
y=20;

                                                        24
n=2;
for(int j=0;j<8;j++)
{
delay(30);
gotoxy(x,y);
cout<<users[i];
y--;
gotoxy(x,y+2);cout<<" ";
gotoxy(m,n);cout<<admins[i];
n++;
gotoxy(m,n-2);cout<<" ";
}
cout<<" ";
}
cout<<"nnnttttt";
ch=getche();
if(ch=='a'||ch=='A')
{
a.admn();
}
else if(ch=='u'||ch=='U')
{
u.umenu();
}
else
{
cout<<"nWRONG CHOICE"<<endl;
goto v;
}
p1=0;
v:cout<<"nPress "e" to exit"<<endl;
cout<<"Press "s" to switch to user or admin mode"<<endl;
c1=getche();
}
if(c1=='e'||c1=='E')    //EXIT Module
{
ex:textbackground(0);
textcolor(13);
clrscr();
int x=1,y=1;
clrscr();
ch=char(2);
for(i=0;i<80;i++)
{
gotoxy(x,1);
delay(20);
cout<<ch;
gotoxy(x,20);
cout<<ch;
gotoxy(80-x,1) ;
delay(20);
cout<<ch;
gotoxy(80-x,20);
cout<<ch;
x++;
if(i<20)

                                                             25
{
delay(20);
gotoxy(1,y);
cout<<ch;
gotoxy(80,y);
cout<<ch;
y++;
}
}
gotoxy(1,21);
cout<<" ";
gotoxy(2,21);
cout<<" ";
gotoxy(16,4);
int j=28;
char temp[40]={"THEATRE MANAG"};
char tem[20]= {"TCEJORP TNEME"};
for(j=0,i=0;i<13;i++)
{
delay(100);
gotoxy(30+i,4);
cout <<temp[i];
gotoxy(55-i,4);
cout<<tem[j];
j++;
}
gotoxy(3,10);
cout<<"DONE BY ";
gotoxy(50,13);
strcpy(temp,"G RAJESH");
x=50;
for(i=0;i<40;i++)
{
x--;
delay(50);
gotoxy(x,13);
cout<<temp;
gotoxy(x+8,13) ;
cout<<" " ;
}
delay(800);
gotoxy(10,14);
cout<<"12th Science ";
delay(100);
gotoxy(10,15);
cout<<"///////";
gotoxy(10,17);
delay(600);
cout<<"KASTURBA ENGLISH MEDIUM SCHOOL, MANJUMMEL";
delay(1000);
for(i=0;i<110;i++)
{
textcolor(i);
delay(50);
gotoxy(2,21);cout<<endl;
cout<<"n";

                                                     26
cputs("n             _/_/_/_/_/ _/                            _/
");cout<<endl;
cputs("                 _/       _/_/_/      _/_/_/ _/_/_/    _/     _/
");cout<<endl;
cputs("                 _/       _/   _/   _/    _/ _/   _/   _/_/
");cout<<endl;
cputs("                 _/       _/   _/   _/    _/ _/   _/   _/ _/
");cout<<endl;
cputs("                 _/       _/   _/    _/_/_/   _/  _/   _/
_/");cout<<endl;
cout<<"nnn";
cputs("                    _/    _/
");cout<<endl;
cputs("                     _/ _/ _/_/_/_/ _/      _/
");cout<<endl;
cputs("                      _/     _/    _/ _/    _/
");cout<<endl;
cputs("                       _/    _/    _/ _/     _/
");cout<<endl;
cputs("                      _/     _/_/_/_/ _/_/_/_/
");cout<<endl;
}
cout<<"nnn Press any key to exit"<<endl;
getch();
cout<<"n Program Teriminated"<<endl;
delay(500);
exit(0);
}
getch();
}

void admin::admn()
{
char temp[]={"nnttW E L C O M E   T O    I M A X  D A T A B A S
E "};
clrscr();
textcolor(4);
textbackground(0);
clrscr();
int j;
if(p1==1)
goto l;
for(i=0;i<3;i++)             //Checking Password & User Name
Combination
{
delay(300);
clrscr();
cout<<"nttAUTHENTICATION REQUIRED"<<endl;
cout<<"nUserName: "<<endl;
cout<<"PassWord: "<<endl;
gotoxy(10,4);
gets(aname);
gotoxy(10,5);
for(j=0;j<20;j++)
{
apass[j]=getch();

                                                                      27
if(apass[j]=='r')
break;
cout<<"*";
}
apass[j]='0';
cout<<"nChecking Username and Password Combination ";
for(int che=0;che<7;che++)
{
delay(300);cout<<".";
}
if((strcmp(aname,"raj32")==0))
{
if((strcmp(apass,"rgr2511")==0) )
{
p=1;
break;
}
else
{
 p=0;
 cout<<"anWrong User Name and Pass Word combination"<<endl;
 if(i==2)
 {
 cout<<"nAUTHENTICATION FAILED!!!"<<endl;
 cout<<"nEXITING"<<endl;
 delay(900);
 exit(0);
 }
 else
 {
 cout<<"No. of chances remaining: "<<(2-i)<<endl;
 delay(900);
 }
}
}
}
if(p==1)
{
clrscr();
textcolor(10);
clrscr();
gotoxy(20,20);
cout<<" L O G I N   S U C C E S S F U L !!"<<endl; //Welcome Screen
For Admin
delay(1000);
textcolor(14);
clrscr();
gotoxy(1,20);
for(i=0;i<52;i++)
{
delay(70);
cout<<temp[i];
}
delay(800);
l:
if(i==3)

                                                                 28
goto ex;
textcolor(aj);
textbackground(ai);
clrscr();
cout<<"nt                           ADMIN'S MENUn"<<endl;
delay(500);
gotoxy(46,7);
cout<<""T" TICKET initialising";
delay(500);
gotoxy(52,13);
cout<<""A"";
cout<<" MOVIES running";
delay(500);
gotoxy(47,19);
cout<<""M"";
cout<<" MODIFY menu ";
gotoxy(20,19);
delay(500);
cout<<"colour SETTINGS "S"";
gotoxy(16,13);
delay(500);
cout<<"BOOKING list "B"";
gotoxy(21,7);
delay(500);
cout<<"EXIT as ADMIN ";
cout<<""E"";
gotoxy(43,13);
c1=getche();
cout<<endl;
clrscr();
if(c1=='t'||c1=='T')
{
a.tcrun();
}
else if(c1=='s'||c1=='S')
{
settings();
}
else if(c1=='a'||c1=='A')
{
cout<<"nThe Movies Running In IMAX are :"<<endl;
delay(800);
clrscr();
fout.open("mt.txt",ios::in);
while(fout.read((char*)&a,sizeof(a)))
{
a.result();
}
fout.close();
for(i=0;i<80;i++)
cout<<"=";
cout<<"nn"<<endl;
i=0;
cout<<"Press Any Key To Continue"<<endl;
getch();
cout<<"nnRedirecting To ADMIN'S MENU "<<endl;

                                                               29
p1=1;
a.admn();
}
else if(c1=='m'||c1=='M')
{
a.modify();
}
else if(c1=='E'||c1=='e')
{
ex:goto g;
}
else if(c1=='b'||c1=='B')
{
cout<<"nBooking List "<<endl;
u.showbooked();
a.admn();
}
else
{
cout<<"Wrong Choice nEnter Again"<<endl;
p1=1;
admn();
delay(200);
g:cout<<"Returning ....."<<char(24)<<endl;
delay(1800);
clrscr();
}
}
}
void admin::modify()
{
c1='y';
while(c1=='y'||c1=='Y')
{
clrscr();
delay(400);
cout<<"t     tttMODIFYING MENU"<<endl<<endl;
delay(400);
cout<<"tttt";
cout<<" ADD movies "<<endl;
cout<<"tttt";
cout<<"   " A ""<<endl;
delay(400);
cout<<endl;
cout<<"tttttt"D" DELETE movies " <<endl;
cout<<endl;
delay(400);
cout<<endl;
cout<<"tttt";
cout<<"   " M " "<<endl;
cout<<"tttt";
cout<<" EDIT movies "<<endl;
delay(400);
gotoxy(12,6);
cout<<"ADMIN'S menu "E""<<endl;
gotoxy(38,6);

                                                   30
c2=getche();

gotoxy(30,15);
if(c2=='a'||c2=='A')
{
add();
}
else if(c2=='m'||c2=='M')
{
edit();
}
else if(c2=='d'||c2=='D')
{
del();
}
else if(c2=='e'||c2=='E')
{
goto mex;
}
else
{
cout<<"Wrong Choice"<<endl;
}
cout<<"nWant to continue modify"<<endl;
c1=getche();
}
if(c1=='n'||c1=='N')
{
mex:p1=1;
admn();
}
}
void admin::settings()
{
i=0;
int bk,tb;
y:cout<<"Customize The Background Colour and Text Colour "<<endl;
cout<<"Press 1 for Main Menu (Welcome Screen ) settings"<<endl;
cout<<"Press 2 for Admin Menu settings"<<endl;
cout<<"Press 3 for User Menu settings "<<endl;
cout<<"Press 4 to return to admin's menu"<<endl;
cin>>i;;
if(i>4)
{
cout<<"WRONG CHOICE "<<endl;
cout<<"Enter Again"<<endl;
goto y;
}
if(i==4)
{
cout<<"Returning "<<char(24)<<endl;
delay(400);
i=0;
p1=1;
p=0;
goto d;

                                                                    31
}
cout<<"tt╔════════════════════════╗ "<<endl;
cout<<"tt║number:color            ║ "<<endl;
cout<<"tt║                        ║ "<<endl;
cout<<"tt║ 0    =   Black         ║ "<<endl;
cout<<"tt║ 1    =   Blue          ║ "<<endl;
cout<<"tt║ 2    =   Green         ║ "<<endl;
cout<<"tt║ 3    =   Cyan          ║ "<<endl;
cout<<"tt║ 4    =   Red           ║ "<<endl;
cout<<"tt║ 5    =   Purple        ║ "<<endl;
cout<<"tt║ 6    =   Yellow        ║ "<<endl;
cout<<"tt║ 7    =   White         ║ "<<endl;
cout<<"tt╚════════════════════════╝ "<<endl;
cout<<"nEnter the colour Number for Background colour ";
cin>>bk;
if(bk>7)bk=bk-1;
cout<<"nEnter The Colour Number for Text Colour       ";
cin>>tb;
cout<<endl<<endl;
tb=tb+8;
switch(i)
{
case 1:
mi=bk;
mj=tb;
break;
case 2:
ai=bk;
aj=tb;
break;
case 3:
ui=bk;
uj=tb;
break;
}
cout<<" Applying Settings ";
for(i=0;i<6;i++)
{
delay(500);
cout<<".";
}
cout<<"n Settings Have Been Applied"<<endl;
delay(700);
cout<<" Note: You Need To Exit As Admin"<<endl;
getch();
p1=1;
i=3;
d:a.admn();
}
void admin::add()     //For Adding Movies into The List
{
cout<<"ADDING MOVIES "<<endl;
fout.open("mt.txt",ios::out|ios::app);
do
{
cout<<"nMovie Name "<<endl;

                                                            32
gets(mname);
cout<<"Language "<<endl;
gets(mlang);
cout<<"Rating "<<endl;
cin>>mstars;
cout<<"Description "<<endl;
gets(mdes);
cout<<"Actors "<<endl;
gets(mactors);
cout<<"Director "<<endl;
gets(mdirector);
cout<<"CBFC rating "<<endl;
gets(mcbfc);
cout<<"Timings"<<endl;
gets(mtiming);
cout<<"Price "<<endl;
cin>>mprice;
cout<<"Seats "<<endl;
cin>>mseats;
fout.write((char*)&a,sizeof(a));
cout<<"nDetails Entered Successfully"<<endl;
cout<<"nWant to add more movies(y/n)"<<endl;
c2=getche();
}
while(c2=='y'||c2=='Y');
fout.close();
}
void admin::edit()    //For Editing The Added Movies
{
p=0;
r=0;
float pos;
fin.open("mt.txt",ios::in);
fin.seekg(0);
i=0;
cout<<"Movies In IMAX :"<<endl;
while(fin.read((char*)&a,sizeof(a)))
{
delay(200);
i++;
cout<<i<<" ";
cout<<char(14);
cout<<" "<<mname<<endl;
}
fin.close();
r=0;
fin.open("mt.txt",ios::in|ios::out);
char name[20];
int nrating,nos;
float nprice;
char nname[20],ntim[20],ndes[10];
cout<<"n"<<endl;
cout<<"Editing "<<endl;
cout<<"Enter The Movie Number To be Edited(0 to Cancel
Editting)"<<endl;
cin>>r;

                                                         33
if(r==0)
goto k;
i=0;
fin.seekp(0);
while(fin)
{
i++;
pos=fin.tellg();
fin.read((char*)&a,sizeof(a));
if(i==r)
{
cout<<"Movie Foundn Details";
for(int h=0;h<6;h++)
{
delay(90);
cout<<".";
}
clrscr();
result();
cout<<"Now Edit"<<endl;
cout<<"nnPress ! in any field to retain the old detail"<<endl;
cout<<"Enter new Name: ";
gets(nname);
cout<<"Enter new Description: ";
gets(ndes);
cout<<"Enter new Timmings: ";
gets(ntim);
cout<<"Enter new Price: ";
cin>>nprice;
cout<<"Enter new rating(press 0 to retain old one): ";
cin>>nrating;
cout<<"No oF Seats";
cin>>nos;
if(strcmp(nname,"!")!=0)
strcpy(mname,nname);
if(strcmp(ndes,"!")!=0)
strcpy(mdes,ndes);
if(mprice!=nprice)
mprice=nprice;
if(nrating!=0)
mstars=nrating;
if(strcmp(ntim,"!")!=0)
strcpy(mtiming,ntim);
if(nos!=0)
mseats=nos;
fin.seekg(pos);
fin.write((char*)&a,sizeof(a));
fin.close();
p=1;
break;
}
}
if(p==0)
{
cout<<"Wrong Movie Number"<<endl;
cout<<"Redirecting to modify menu"<<endl;

                                                                   34
delay(300);
modify();
}
fout.open("mt.txt",ios::in);
cout<<"Now The Movies are.. :n"<<endl;
delay(500);
fout.seekg(0);
clrscr();
while(fout.read((char*)&a,sizeof(a)))
{
result();
}
fout.close();
for(i=0;i<80;i++)
cout<<"=";
cout<<"nn"<<endl;
k:i=0;
}
void admin::result()   //To Show Details Of A Movie
{
gotoxy(30,20);
for(i=0;a.mname[i]!='0';i++)
{
delay(30);
cout<<a.mname[i];
}
cout<<"               ";
delay(200);
gotoxy(31,21);
cout<<a.mdes<<"         ";
gotoxy(27,25);
delay(600);
cout<<"DIRECTED by "<<a.mdirector<<"            ";
gotoxy(27,16);
delay(500);
cout<<"STARRING "<<a.mactors<<"                       ";
gotoxy(4,19);
delay(300);
cout<<"      LANGUAGE -"<<a.mlang<<" ";
gotoxy(4,21);
delay(300);
cout<<" rating by CBFC-"<<a.mcbfc<<" ";
gotoxy(4,23);
delay(300);
cout<<" ticket PRICE -"<<a.mprice<<" ";
gotoxy(54,19 );
delay(300);
cout<<a.mseats<<"("<<a.tick<<")" <<"- SEATS remaining"<<endl;
gotoxy(54,21);
delay(300);
cout<<a.mstars<<" - STARS out of 5"<<endl;
gotoxy(54,23);
delay(300);
cout<<a.mtiming<<"- TIMMING"<<endl;
i=0;
getch();

                                                                35
gotoxy(1,30);
}
void admin::del()    //To Delete A Movie From List
{
p=0;
i=0;
r=0;
fout.open("mt.txt",ios::in);
fout.seekg(0);
i=0;
cout<<"Movies In IMAX :"<<endl;
while(fout.read((char*)&a,sizeof(a)))
{
delay(200);
i++;
cout<<i<<" ";
cout<<char(16);
cout<<" "<<mname<<endl;
}
fout.close();
r=0;
char dname[30];
fin.open("mt.txt",ios::in);
fout.open("temp.txt",ios::out);
cout<<"Enter The Movie Number to be deleted "<<endl;
cin>>r;
i=0;
while(fin.read((char*)&a,sizeof(a)))
{
i++;
if(i==r)
{
cout<<"Movie Detailsn"<<endl;
delay(300);
clrscr();
result();
p=1;
cout<<"Are You Sure You Want To DELETE This Movie "<<endl;
cin>>c1;
if(c1=='n'||c1=='N')
fout.write((char*)&a,sizeof(a));
}
else
fout.write((char*)&a,sizeof(a));
}
if(p==0)
{
cout<<"Wrong Movie Number"<<endl;
delay(500);cout<<"Returning "<<char(24);
delay(1800);
modify();
}
if(c1=='y'||c1=='Y')
cout<<"Movie Successfully Deleted"<<endl;
fin.close();
fout.close();

                                                             36
remove("mt.txt");
rename("temp.txt","mt.txt");
fin.open("mt.txt",ios::in);
cout<<"Now The Movies are :"<<endl;
delay(900);
clrscr();
while(fin.read((char*)&a,sizeof(a)))
{
a.result();
}
fin.close();
cout<<"Press Any Key "<<endl;
getch();
}
void admin::tcrun()         //To Run Ticket Counter/Initialise
Tickets
{
i=0;
cout<<"nProcessing Movies List .";
for(i=0;i<6;i++)
{
delay(300);cout<<".";
}
cout<<endl<<endl;
fout.open("mt.txt",ios::in);
fout.seekg(0);
i=0;
while(fout.read((char*)&a,sizeof(a)))
{
delay(300);
i++;
cout<<i<<" ";
cout<<char(14);
cout<<" "<<mname<<" _ "<<mseats<<endl;
}
fout.close();
r=0;
cout<<"nEnter the movie number to be initialised (0 to
return)"<<endl;
cin>>r;
if(r==0)
goto ex;
fout.open("mt.txt",ios::in|ios::out);
fout.seekg(0);
i=0;
int nseats;
fout.seekg(0);
while(!fout.eof())
{
i++;
pos=fout.tellg();
fout.read((char*)&a,sizeof(a));
if(i==r)
{
cout<<"nprocessing "<<mname<<endl;
delay(400);

                                                                 37
cout<<"Enter The No of seats for the movie"<<endl;
cin>>nseats;
delay(300);
cout<<"Initialising tickets with 0"<<endl;
mseats=nseats;
tick=0;
fout.seekg(pos);
fout.write((char*)&a,sizeof(a));
p=1;
break;
}
}
fout.close();
if(p==0)
cout<<"Movie Not Found"<<endl;
cout<<"redirecting"<<endl;
delay(400);
ex:cout<<"nReturning To Main Menu"<<char(24)<<endl;
delay(1800);
p1=1;
admn();
}
void admin::seatmanage(int s)   //Function to Manage seats of a
movie
{                                //after booking ,cancelling and
modifying....
file.open("mt.txt",ios::in|ios::out);
while(!file.eof())
{
pos=file.tellg();
file.read((char*)&a,sizeof(a));
if(strcmp(name,a.mname)==0)
{
a.tick=a.tick+s;
a.mseats=a.mseats-s;
file.seekg(pos);
file.write((char*)&a,sizeof(a));
break;
}
}
file.close();
}
void admin::amtcal(int c3)
{
file.open("mt.txt",ios::in);
while(file.read((char*)&a,sizeof(a)))
{
if(strcmp(name,a.mname)==0)
{
cout<<"Amount Payable :";
delay(300);
cout<<c3;
delay(400);
cout<<"x";
delay(500);
cout<<mprice;

                                                                   38
delay(500);
cout<<" = Rs.";
delay(900);
float q;
q=mprice*(c3);
cout<<q<<endl;
break;
}
}
file.close();
} //End Of Functions Definition of class admin



void user::umenu()   //Funtion For User Module's Main Menu And
Welcome Screen
{
textcolor(uj);
textbackground(ui);
clrscr();
if(p1==1)
z:goto u;
clrscr();
cout<<"tttt     DEAR USER"<<endl;
u:char temp[40]={"W E L C O M E   T O   "I M A X" "};
gotoxy(60,3);
int x=70,y;
for(i=0;i<45;i++)
{
x--;
delay(70);
gotoxy(x,3);
cout<<temp;
cout<<" " ;
}
cout<<endl;
cout<<"ntttt   USER'S MENU"<<endl<<endl;
y=6,x=60;
char book[]={"BOOK MOVIES"};
char modi[]={"MODIFY BOOKING"};
char canc[]={"CANCEL BOOKING"};
char exit[]={"EXIT AS USER"};
for(i=0;i<18;i++)
{
if(i%2==0)
{
y++;
gotoxy(36,y);
delay(70);
cout<<book;
gotoxy(36,y-1);
cout<<"            ";
delay(70);
gotoxy(36,40-y);
cout<<exit;
gotoxy(36,41-y);

                                                                 39
cout<<"             ";
}
else
{
x-- ;
gotoxy(70-x,20);
delay(70);
cout<<modi;
gotoxy(69-x,20);
cout<<" ";
delay(70);
gotoxy(x,20);
cout<<canc;
cout<<" ";
}
}
delay(200);gotoxy(40,23);cout<<""E"";
delay(200);gotoxy(x-4,20);cout<<""C"";
delay(200);gotoxy(40,y+2);cout<<""B"";
delay(200);gotoxy(x-17,20);cout<<""M"";
time_t t;
t = time(NULL);
gotoxy(2,8);cout<<"DATE-";
gotoxy(8,8);cout<<ctime(&(t));gotoxy(18,8);cout<<"
";
gotoxy(55,8);cout<<ctime(&(t));gotoxy(55,8);cout<<"     TIME- ";
gotoxy(71,8);cout<<"        ";
gotoxy(41,20);
c1=getche();
gotoxy(39,28);
if(c1=='e'||c1=='E')
{
goto f;
}
else if(c1=='b'||c1=='B')
{
p=0;
cout<<"nBooking "<<endl;
a:cout<<"Movies Now Playing in IMAX With Seat Numbers in ( )"<<endl;
fin.open("mt.txt",ios::in);
fin.seekg(0);
i=0;
cout<<endl;
while(fin.read((char *)&a,sizeof(a)))
{
delay(500);
i++;
cout<<i;
cout<<" "<<char(14);
cout<<" "<<a.mname<<" (";
a.showseats();cout<<" )"<<endl;
}
fin.close();
r=0;
cout<<"nEnter The Number to Book (0 to exit)"<<endl;
cin>>r;

                                                                  40
if(r==0)
{
cout<<"Returning.."<<char(24)<<endl;
delay(1800);
clrscr();
goto z;
}
i=0;
fin.open("mt.txt",ios::in);
while(fin.read((char*)&a,sizeof(a)))
{
i++;
if(i==r)
{
pos=fin.tellg();
strcpy(u.mov,a.mname);
ubooking();
p=1;
break;
}
}
if(p==0)
{
cout<<"Wrong Movie Number ... Choose Once Again"<<endl;
fin.close();
goto a;
}
}
else if(c1=='c'||c1=='C')
{
u.ucancel();
}
else if(c1=='M'||c1=='m')
{
u.uedit();
}
else
{
cout<<"Wrong Choice"<<endl;
cout<<"Enter Again "<<endl;
umenu();
}
f:cout<<endl;
}

void user::ubooking()
{
cout<<"Movie Details :"<<endl;
delay(500);
clrscr();
fin.seekg(pos);
a.result();
strcpy(name,a.mname);
fin.close();
gotoxy(40,40);
cout<<"nMOVIE BOOKING "<<endl;

                                                          41
cout<<"Enter Your name "<<endl;
gets(uname);
cout<<"Enter your age "<<endl;
cin>>uage;
cout<<"Enter the no. of tickets to be booked "<<endl;
cin>>uno;
cout<<"Enter your phone number or email id"<<endl;
gets(uphone);
cout<<"Want To confirm booking for ";puts(name);
c2=getche();
if(c2=='y')
{
i=0;
fout.open("mb.txt",ios::out|ios::app);
cout<<"nYour Ticket number(s) are:"<<endl;
tcallote();
cout<<"Your Main Ticket number is: "<<u.utc<<endl;
a.seatmanage(u.uno);
fout.write((char*)&u,sizeof(u));
a.amtcal(u.uno);
delay(600);
cout<<"nnT H A N K   Y O U F O R B O O K I N G
"<<char(1)<<char(2)<<endl;
cout<<"Enjoy The Movie"<<endl;
delay(80);
cout<<endl<<endl;
textcolor(ui+2);
cputs("* NOTE :Use your Main Ticket Number Given Above");cout<<endl;
cputs(" For Cancelling/Changing your Booking *");cout<<endl;
fout.close();
cout<<"Press Enter To Continue"<<endl;
ch=getch();
if(ch=='r')
{
cout<<"Redirecting to user menu"<<endl;
cout<<char(24)<<endl;
delay(1800);
}
umenu();
}
if(c2=='n')
{
p1=1;
umenu();
}
}
void user::tcallote() //Allocating Ticket Number After Booking a
Movie
{
c2='n';
int cnt=u.uno;
fstream f1;
int tics;
f1.open("mt.txt",ios::app|ios::in);
while(f1.read((char*)&a,sizeof(a)))
{

                                                                  42
if(strcmp(a.mname,name)==0)
{
tics=a.tick;
while(cnt>0)
{
tics++;
cnt--;
cout<<tics<<endl;
delay(300);
}
break;
}
}
f1.close();
u.utc=tics;
}
void user::ucancel()    // For Cancelling The Movie Booked
{
cout<<"Enter The Movie U booked for"<<endl;
fstream f1;
f1.open("mb.txt",ios::in);
i=0;
f1.seekg(0);
while(f1.read((char *)&u,sizeof(u)))
{
i++;
cout<<i<<" "<<char(13)<<" "<<mov<<endl;
}
r=0;
f1.close();
f1.open("mb.txt",ios::in);
f1.seekg(0);
cin>>r;i=0;
while(f1.read((char *)&u,sizeof(u)))
{
i++;
if(i==r)
{
strcpy(name,mov);
cout<<"nMovie selected :"<<name<<endl;
}
}
f1.close();
cout<<"Canceling...."<<endl;
cout<<"Enter Your Main Ticket Number "<<endl;
cin>>r;
fin.open("mb.txt",ios::in);
fout.open("temp.txt",ios::out);
while(fin.read((char*)&u,sizeof(u)))
{
if((r==utc)&&strcmp(name,u.mov)==0)
{
p=1;
cout<<"FOUND"<<endl;
cout<<"Name :";puts(uname);
cout<<"Ticket No:"<<utc<<endl;

                                                             43
cout<<"Movie :"<<u.mov<<endl;
strcpy(name,u.mov);
cout<<"CANCEL BOOKING????"<<endl;
c2=getche();
if(c2=='n'||c2=='N')
fout.write((char*)&u,sizeof(u));
}
else
{
fout.write((char*)&u,sizeof(u));
}
}
if(c2=='y'||c2=='Y')
{
strcpy(name,mov);
cout<<"Your Ticket Is Successfully Cancelled"<<endl;
a.seatmanage((-u.uno));
}
if(p==1&&c2!='y')
cout<<"Your Ticket Is not Cancelled"<<endl;
if(p!=1)
cout<<"Not Found"<<endl;
fin.close();
fout.close();
remove("mb.txt");
rename("temp.txt","mb.txt");
cout<<"Press Any Key"<<endl;
getch();
canex:cout<<"Redirecting to User Menu"<<char(24)<<endl;delay(1800);
umenu();
}

void user::uedit()       //For Changing The Details Of No. of
Tickets,Contact Details
{
cout<<"Enter The Movie U booked for"<<endl;
fstream f1;
f1.open("mb.txt",ios::in);
i=0;
f1.seekg(0);
while(f1.read((char *)&u,sizeof(u)))
{
i++;
cout<<i<<" "<<char(13)<<" "<<mov<<endl;
}
cin>>r;
f1.close();
i=0;
f1.open("mb.txt",ios::in);
f1.seekg(0);
while(f1.read((char *)&u,sizeof(u)))
{
i++;
if(i==r)
{
strcpy(name,u.mov);

                                                                  44
cout<<"Movie Selected :"<<name;
}
}
f1.close();
float pos;
int t;
p=0;
cout<<"nModify Your Booking "<<endl;
fout.open("mb.txt",ios::in|ios::out);
cout<<"Enter Your Ticket Number :"<<endl;
cin>>t;
int n;
char cnt[30];
fout.seekg(0);
while(fout)
{
pos=fout.tellg();
fout.read((char*)&u,sizeof(u));
if(t==u.utc&&strcmp(name,u.mov)==0)
{
cout<<"OLD DETAILS "<<endl;
i=uno;
cout<<"Name :";
puts(uname);
cout<<"Movie :";
puts(a.mname);
cout<<"Age :"<<uage<<endl;
cout<<"No. of Tickets Booked :"<<i<<endl;
cout<<"Contact info :";
puts(uphone);
cout<<"nntEnter New Details"<<endl;
cout<<"Enter Your Name "<<endl;
gets(aname);
cout<<"Enter the no. of tickects to be booked "<<endl;
cin>>n;
cout<<"Enter the contact details "<<endl;
gets(cnt);
if(strcmp(aname,"!")!=0)
strcpy(uname,aname);
if(strcmp(cnt,"!")!=0)
strcpy(uphone,cnt);
if(n!=0)
uno=n;
fout.seekg(pos);
fout.write((char*)&u,sizeof(u));
fout.close();
p=1;
break;
}
}
if(p==0)
cout<<"Not Found "<<endl;
else
{
strcpy(name,u.mov);
if(i>n)

                                                         45
a.seatmanage((n-i));
if(n>i)
a.seatmanage((i-n));
delay(300);
cout<<"Details Saved"<<endl;
}
cout<<"Press Any Key"<<endl;
getch();
cout<<"Redirecting to User Menu "<<char(24)<<endl;delay(1800);
umenu();
}
void user::showbooked() //Function Used by Admin To See Booked List
{

cout<<"                        B O O K I N G   L I S T "<<endl;
fin.open("mb.txt",ios::in);
while(fin.read((char*)&u,sizeof(u)))
{
cout<<endl;
for(i=0;i<70;i++)
cout<<char(4);
cout<<"nMovie Booked:"<<mov;
cout<<"nName: ";
puts(u.uname);
cout<<"Ticket no:"<<u.utc<<endl;
cout<<"Age :"<<u.uage<<endl;
cout<<"No. Of Tickets: "<<u.uno<<endl;
cout<<"Contact Details: "<<u.uphone<<endl;
for(r=0;r<70;r++)
cout<<char(4);
getch();
}
cout<<endl<<endl;
for(i=0;i<80;i++)
cout<<char(39);
cout<<"End Of Booked List"<<endl;
fin.close();
cout<<"Press Any Key To Continue"<<endl;
getch();
cout<<"Returning to Admin's Menu"<<char(24)<<endl;
delay(1000);
p1=1;
a.admn();
}             //END OF PROGRAM




                                                                  46
 OUTPUT




Welcome screens




                  47
48
if choice = ‘a’(admin module)




                                49
if choice=’m’(modify menu) if choice=’a’(add movies)




if choice=’d’(delete movies)




                                                       50
Back to Admins menu & choice==’a’(movies running)




back to admin’s menu &choice=’s’(settings)




                                                    51
Back to welcome screen




user’s menu




                         52
if choice=’b’(book movies)




                             53
if choice==’c’(cancelling booking)




if choice=’e’(exit as user)




                                     54
Exit screen




              55
 Bibliography
 www.cplusplus.com
 Help menu on turbo c++
 Computer science with c++ (12th class text)




                                                56
Thank you




            57
58

Contenu connexe

Tendances

C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTAbhishek Shukla
 
Bca sem 6 php practicals 1to12
Bca sem 6 php practicals 1to12Bca sem 6 php practicals 1to12
Bca sem 6 php practicals 1to12Hitesh Patel
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practicalNitesh Dubey
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALVivek Kumar Sinha
 
Computer science project work on C++
Computer science project work on C++Computer science project work on C++
Computer science project work on C++NARESH KUMAR
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++vikram mahendra
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlOdoo
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsVishvjeet Yadav
 
Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtextmeysholdt
 
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECTMOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECTSindhu Ashok
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Rushil Aggarwal
 

Tendances (20)

C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECT
 
Bca sem 6 php practicals 1to12
Bca sem 6 php practicals 1to12Bca sem 6 php practicals 1to12
Bca sem 6 php practicals 1to12
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practical
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Computer science project work on C++
Computer science project work on C++Computer science project work on C++
Computer science project work on C++
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Links in Html
Links in HtmlLinks in Html
Links in Html
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in Owl
 
School Management (c++)
School Management (c++) School Management (c++)
School Management (c++)
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Computer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commandsComputer Science Practical Science C++ with SQL commands
Computer Science Practical Science C++ with SQL commands
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
Html forms
Html formsHtml forms
Html forms
 
Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtext
 
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECTMOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
 
Learning Svelte
Learning SvelteLearning Svelte
Learning Svelte
 

En vedette

Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ reportvikram mahendra
 
Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)Binary Studio
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14Matthieu Garrigues
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearDezyneecole
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearDezyneecole
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)Debashis Rath
 
documentation on bank management system
documentation on bank management systemdocumentation on bank management system
documentation on bank management systemUnsa Jawaid
 
Functions Of Operating Systems
Functions Of Operating SystemsFunctions Of Operating Systems
Functions Of Operating SystemsAkshay Kurup
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMNitish Xavier Tirkey
 
Distributed blood bank management system database
Distributed blood bank management system databaseDistributed blood bank management system database
Distributed blood bank management system databaseSaimunur Rahman
 

En vedette (15)

Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
 
Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third Year
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third Year
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
Bank Management System
Bank Management SystemBank Management System
Bank Management System
 
documentation on bank management system
documentation on bank management systemdocumentation on bank management system
documentation on bank management system
 
Functions Of Operating Systems
Functions Of Operating SystemsFunctions Of Operating Systems
Functions Of Operating Systems
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEM
 
Distributed blood bank management system database
Distributed blood bank management system databaseDistributed blood bank management system database
Distributed blood bank management system database
 
BLOOD BANK SOFTWARE PRESENTATION
BLOOD BANK SOFTWARE PRESENTATIONBLOOD BANK SOFTWARE PRESENTATION
BLOOD BANK SOFTWARE PRESENTATION
 

Dernier

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Dernier (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

c++ report file for theatre management project

  • 1. C++ PROJECT 2012-2013 C++ PROJECT 2012-2013C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT REPORT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT 2012-2013 C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT DONE BY :G RAJESH C++ PROJECT C++ PROJECT C++ PROJECT C++ 12TH A PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ KASTURBA ENGLISH MEDIUM SCHOOL , PROJECT C++MANJUMMEL C++ PROJECT C++ PROJECT C++ PROJECT PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++TOPIC:THEATRE MANAGEMENT C++ PROJECT C++ PROJECT C++ PROJECT PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT 1 C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT 1 C++PROJECT C++ PROJECT C++ PROJECT C++ PROJECT
  • 3. KASTURBA ENGLISH MEDIUM SENIOR SECONDARY SCHOOL Affiliated to CBSE, New Delhi, Aff. No. : 930463 Report on the Computer Project Name : G RAJESH Standard : XII Science Project Guide : Aravind Lakshman Project : MOVIE RESERVATION Certified that this is the bonafide report of the project work of G Rajesh in this school submitted for the practical examination held in 2013, Kasturba School, Manjummel. Examiner Project Guide Principal 3
  • 4. KASTURBA ENGLISH MEDIUM SENIOR SECONDARY SCHOOL Affiliated to CBSE, New Delhi, Aff. No. : 930463 Bonafide Certificate I certify that G Rajesh Student of Computer Science studying in Std XII, Kasturba Senior Secondary School, Manjummel has successfully completed the project “MOVIE RESERVATION” under my guidance during the year 2012-2013 Project Guide 4
  • 5. INDEX  1.ACKNOWLEDGEMENT  2.AIM  3. APPARATUS  4. FLOW CHART  5. PROGRAM DESCRIPTION  6. PROGRAM CODE 7. OUTPUT 8.BIBILIOGRAPHY 5
  • 6.  ACKNOWLEDGEMENT I Would Like To Express My Deep Sense Of Gratitude To All Those Who Have Helped Me In Completing This Project. I Specially Thank Our Sir Aravind Lakshman Who Gave Me All Guidance To Complete My Project Work Successfully. Apart From It, I Acknowledge My Parents, Group members And All Others Who Helped Me For Completing This Great Task. Above All I Thank The Almighty God For Making This Project A Great Success.  AIM 6
  • 7. This is a program done in C++ language to reserve a movie ticket by users from a list of movies which are managed by the administrator. The user must provide his name and other details to book his/her desired movie in the list.  APPARATUS 7
  • 8. HARDWARE:-  LOGITECH MOUSE  LOGITECH KEYBOARD  HP PRINTER  INTEL DUAL CORE  LCD MONITOR SOFTWARE:-  WINDOWS XP  TURBO C++  MS DOS  MS WORD  FLOW CHART 8
  • 10. WELCOME SCREEN MAIN MENU ADMIN (‘A’) USER (‘U’) A A If PASSWORD Choice== TRUE AND USERNAME FALSE EXIT ’a’||’a’ a1 TRUE TICKET INITIALISE(‘T’) MOVIE LIST(‘A’) ADMIN MENU MODIFY MENU(‘M’ SETTINGS(‘S’) BOOKING LIST(‘B’) ach EXIT(‘E’) BOOK(‘B’) CANCEL(‘C’) USER MENU If choice !=’U’ 10 && !=’A’
  • 11. TRUE MODIFY(‘M’) EXIT AS USER(‘E’) ELSE EXIT(‘E’) mch SWITCH(‘S’) m2 ach a1 TICKETS INITIALISE If Choice== ’t’||’T’ TRUE TC.TXT a3 a1 If Choice== DISPLAY ALL MOVIE’S DETAILS ’a’||’A’ TRUE MT.TXT a2 11
  • 12. ADD MOVIES(‘A’) EDIT MOVIES(‘E’) If Choice== MODIFYING ’m’||’M’ MENU TRUE MODIFY MOVIES(‘M’) EXIT MODIYING(‘E’) ach 2 READ CHOICE a1 If Choice== BOOKING LIST ’b’||’B’ TRUE MB.TXT If Choice== COLOUR SETTINGS m1 ’s’||’S’ TRUE If Choice== m2 ’e’||’E’ TRUE a1 ELSE ach 2 12
  • 13. ADD MOVIES if choice== a3 ‘a’||’A’ TRUE MT.TXT If choice== MODIFY MOVIE a3 ‘m’||’M’ TRUE MT.TXT If choice== ‘d’||’D’ TRUE DELETE MOVIE a3 MT.TXT If choice== a1 TRUE ‘e’||’E’ a2 ELSE uch u1 13
  • 14. If choice== TRUE BOOK MOVIE ‘b’||’B’ MB.TXT u1 DETAILS u1 MB.TXT If choice== TRUE CANCEL BOOKING TRUE ‘c’||’C’ FALSE u1 TICKET NUMBER u1 MB.TXT If choice== TRUE MODIFY BOOKING TRUE ‘m’||’M’ FALSE u1 TICKET NUMBER If choice=== TRUE m2 ‘e’||’E’ ELSE u1 mch 14
  • 15. If choice=== TRUE EXIT EXIT ‘e’||’E’ SCREEN If choice=== m1 TRUE ‘s’||’S’  PROGRAM DESCRIPTION 15
  • 16. This is a user friendly and menu driven program which is designed to book tickets for a movie by the user by providing the necessary details....... When the program is executed ,the welcome screen appears showing the logo of the theatre‟s name and then shows the option to enter as an admin or a user. The Admin menu is accessible only after providing the right username and password combination within 3 chances.  The admin module has 6 options :  Initialise tickets („T‟)  Movies running („A‟)  Modify movies („M‟) 16
  • 17.  Settings („S‟)  See booking list („B‟)  Exit as admin („E‟) The “modify movies” option has a menu of adding movies, deleting current movies and editing the current movie details. The option “settings” deals with customizing the background colour and text colour. The user menu has a simple menu containing the options:  Book a movie(„B‟)  Modify a booking(„M‟)  Cancel a booking(„B‟)  Exit as user(„E‟) When the “book a movie” option is selected the list of all movies running in the theatre is shown. The user has to select a movie and then enter his/her details like name, age, number of tickets to be booked and contact 17
  • 18. details. The total fare is calculated and is shown along with the main ticket number. The program is a very interactive and interesting with colourful texts and coloured background for each module making it very close to real life booking of movie tickets as on internet....  PROGRAM CODE 18
  • 19. /* ****** T H E A T H T R E M A N A G E M E N T P R O J E C T ****** Done By: G Rajesh 12th Science 2012-2013 Kasturba English Medium School Manjummel */ #include<iostream.h> //For Basic Input/output Operations #include<fstream.h> //For File Handling Operations #include<conio.h> //For getch() & clrscr() Functions #include<dos.h> //For delay() function #include<stdio.h> //For gets(),puts(),remove()& rename().. #include<string.h> //For strcmp() ,strcpy() Functions #include<process.h> //For Exit() Function #include<time.h> //For displaying time in user module int mi=0; int mj=10; int ai=0; int aj=11; int ui=8; int uj=9; char ch,c1,c2,name[30]; //G L O B A L V A R I A B L E S int i,p,p1,r; // used throughout the program long pos; char aname[20],apass[20]; fstream fin,fout,file; //G L O B A L F I L E P O I N T E R S 19
  • 20. class admin //Class Defined for Administration Module { public: char mname[30]; void admn(); void result(); protected: char mlang[20]; char mdes[50]; int mstars; char mactors[30]; char mdirector[20]; float mprice; char mcbfc[5]; char mtiming[20]; private: void tcrun(); void edit(); void modify(); void del(); void add(); void settings(); public: void seatmanage(int); void amtcal(int); int mseats; int tick; admin() // Constructor for class admin { strcpy(mname,"<no name>"); strcpy(mlang,"<no info>"); strcpy(mdes,"<no info>"); strcpy(mactors,"<no info>"); strcpy(mdirector,"<no info>"); strcpy(mcbfc,"n/a"); mstars=0; tick=0; mseats=0; } void showseats() { if(mseats>0) cout<<mseats; else { textcolor(0);cout<<"HOUSE FULL!!!"; } } }a; class user:protected admin //Class for User Module Protectedly Inherited from class Admin { private: char uname[30]; int uage; 20
  • 21. int uno; char uphone[20]; int utc; char mov[30]; public: void showbooked(); void tcallote(); void umenu(); void uedit(); void ucancel(); void ubooking(); user() { strcpy(uname,"empty "); uage=0; uno=0; utc=0; strcpy(uphone,"n/a"); } protected: }u; void main() { clrscr(); int j,k; gotoxy(24,19); cout<<"L O A D I N G P R O J E C T F I L E "<<endl; gotoxy(28,22); cout<<"___________"; j=28; for(int i=0;i<101;i++) { gotoxy(41,22); delay(50); cout<<i<<"% completed"<<endl; if(i%10==0) { gotoxy(j,22); j++; cout<<char(16); } } cout<<"nnttttSUCCESSFULLY LOADED" <<endl; c1='s'; while(c1=='s'||c1=='S') { delay(500); textbackground(mi); textcolor(mj); clrscr(); int i,x=1; cout<<"╔"; delay(100); for(i=0;i<78;i++) { 21
  • 23. textcolor(12); gotoxy(3,3); cputs("╔"); for(i=0;i<75;i++) { cputs("═"); } for(i=4;i<21;i++) { gotoxy(3,i); cputs("║"); } gotoxy(3,20); cputs("╚"); for(i=4;i<78;i++) { gotoxy(i,20); cputs("═"); } cputs("╝") ; for(i=19;i>3;i--) { gotoxy(78,i);cputs("║"); } gotoxy(78,3); cputs("╗"); x=59;int y=10; char c=char(15); for(i=10;i<60;i++) { delay(50); gotoxy(i,10);cout<<c; gotoxy(i-1,10);cout<<" "; } for(i=0;i<6;i++) { delay(100); gotoxy((x-i),(y-i));cout<<c; gotoxy((x+i),(y+i));cout<<c; gotoxy((x+i),(y-i));cout<<c; gotoxy((x-i),(y+i));cout<<c; } int m=x+5,n=x-5; for(i=0;i<40;i++) { delay(60); if(i<13) { gotoxy(m+i,y+5);cout<<c; gotoxy(m+i,y-5);cout<<c; } gotoxy((n-i),y+5);cout<<c; gotoxy((n-i),y-5);cout<<c; } delay(200); gotoxy(27,8);for(i=0;i<5;i++)cout<<c; 23
  • 24. gotoxy(27,9);cout<<" "<<c; gotoxy(27,10);cout<<" "<<c; gotoxy(27,11);cout<<" "<<c; gotoxy(27,12);for(i=0;i<5;i++)cout<<c; delay(200); gotoxy(37,8);cout<<c<<" "<<c; gotoxy(37,9);cout<<c<<" "<<c<<" "<<c<<" "<<c; gotoxy(37,10);cout<<c<<" "<<c<<" "<<c; gotoxy(37,11);cout<<c<<" "<<c; gotoxy(37,12);cout<<c<<" "<<c; delay(200); gotoxy(46,8); cout<<" "<<c; gotoxy(46,9); cout<<" "<<c<<" "<<c; gotoxy(46,10);cout<<" "<<c<<c<<c<<c<<c; gotoxy(46,11);cout<<" "<<c<<" "<<c; gotoxy(46,12);cout<<c<<" "<<c; char temp[]={"IMAX::ENTERTAINMENT UNLIMITED"}; x=46; c=char(2); for(i=0;i<24;i++) { delay(100); gotoxy(x-i,16);cout<<c<<temp<<c; gotoxy((x-i+31),16);cout<<" "; } delay(40);gotoxy(31,17);cout<<"PHC-2,Banglore"<<endl; delay(40);gotoxy(4,19);cout<<"www.etunlimited.com"; gotoxy(65,19);cout<<"Ph:080-623311"<<endl; m=10; y=47; for(i=0;i<34;i++) { m++; textcolor(m+8); textbackground(0); if(m==17)m=1; if(i%2==0) y--; delay(90); gotoxy(33,y); cputs(" PRESS ENTER "); delay(100); gotoxy(33,y+1);cputs(" "); } ch=getch(); if(ch!='r') goto ex; textcolor(5); clrscr(); m=30,n=2,x=30,y=20; char admins[]={"TO LOGIN AS ADMIN "A""}; char users[]={"TO ENTER AS USER "U""}; for(i=0;users[i]!='0';i++) { x++; m++; y=20; 24
  • 25. n=2; for(int j=0;j<8;j++) { delay(30); gotoxy(x,y); cout<<users[i]; y--; gotoxy(x,y+2);cout<<" "; gotoxy(m,n);cout<<admins[i]; n++; gotoxy(m,n-2);cout<<" "; } cout<<" "; } cout<<"nnnttttt"; ch=getche(); if(ch=='a'||ch=='A') { a.admn(); } else if(ch=='u'||ch=='U') { u.umenu(); } else { cout<<"nWRONG CHOICE"<<endl; goto v; } p1=0; v:cout<<"nPress "e" to exit"<<endl; cout<<"Press "s" to switch to user or admin mode"<<endl; c1=getche(); } if(c1=='e'||c1=='E') //EXIT Module { ex:textbackground(0); textcolor(13); clrscr(); int x=1,y=1; clrscr(); ch=char(2); for(i=0;i<80;i++) { gotoxy(x,1); delay(20); cout<<ch; gotoxy(x,20); cout<<ch; gotoxy(80-x,1) ; delay(20); cout<<ch; gotoxy(80-x,20); cout<<ch; x++; if(i<20) 25
  • 26. { delay(20); gotoxy(1,y); cout<<ch; gotoxy(80,y); cout<<ch; y++; } } gotoxy(1,21); cout<<" "; gotoxy(2,21); cout<<" "; gotoxy(16,4); int j=28; char temp[40]={"THEATRE MANAG"}; char tem[20]= {"TCEJORP TNEME"}; for(j=0,i=0;i<13;i++) { delay(100); gotoxy(30+i,4); cout <<temp[i]; gotoxy(55-i,4); cout<<tem[j]; j++; } gotoxy(3,10); cout<<"DONE BY "; gotoxy(50,13); strcpy(temp,"G RAJESH"); x=50; for(i=0;i<40;i++) { x--; delay(50); gotoxy(x,13); cout<<temp; gotoxy(x+8,13) ; cout<<" " ; } delay(800); gotoxy(10,14); cout<<"12th Science "; delay(100); gotoxy(10,15); cout<<"///////"; gotoxy(10,17); delay(600); cout<<"KASTURBA ENGLISH MEDIUM SCHOOL, MANJUMMEL"; delay(1000); for(i=0;i<110;i++) { textcolor(i); delay(50); gotoxy(2,21);cout<<endl; cout<<"n"; 26
  • 27. cputs("n _/_/_/_/_/ _/ _/ ");cout<<endl; cputs(" _/ _/_/_/ _/_/_/ _/_/_/ _/ _/ ");cout<<endl; cputs(" _/ _/ _/ _/ _/ _/ _/ _/_/ ");cout<<endl; cputs(" _/ _/ _/ _/ _/ _/ _/ _/ _/ ");cout<<endl; cputs(" _/ _/ _/ _/_/_/ _/ _/ _/ _/");cout<<endl; cout<<"nnn"; cputs(" _/ _/ ");cout<<endl; cputs(" _/ _/ _/_/_/_/ _/ _/ ");cout<<endl; cputs(" _/ _/ _/ _/ _/ ");cout<<endl; cputs(" _/ _/ _/ _/ _/ ");cout<<endl; cputs(" _/ _/_/_/_/ _/_/_/_/ ");cout<<endl; } cout<<"nnn Press any key to exit"<<endl; getch(); cout<<"n Program Teriminated"<<endl; delay(500); exit(0); } getch(); } void admin::admn() { char temp[]={"nnttW E L C O M E T O I M A X D A T A B A S E "}; clrscr(); textcolor(4); textbackground(0); clrscr(); int j; if(p1==1) goto l; for(i=0;i<3;i++) //Checking Password & User Name Combination { delay(300); clrscr(); cout<<"nttAUTHENTICATION REQUIRED"<<endl; cout<<"nUserName: "<<endl; cout<<"PassWord: "<<endl; gotoxy(10,4); gets(aname); gotoxy(10,5); for(j=0;j<20;j++) { apass[j]=getch(); 27
  • 28. if(apass[j]=='r') break; cout<<"*"; } apass[j]='0'; cout<<"nChecking Username and Password Combination "; for(int che=0;che<7;che++) { delay(300);cout<<"."; } if((strcmp(aname,"raj32")==0)) { if((strcmp(apass,"rgr2511")==0) ) { p=1; break; } else { p=0; cout<<"anWrong User Name and Pass Word combination"<<endl; if(i==2) { cout<<"nAUTHENTICATION FAILED!!!"<<endl; cout<<"nEXITING"<<endl; delay(900); exit(0); } else { cout<<"No. of chances remaining: "<<(2-i)<<endl; delay(900); } } } } if(p==1) { clrscr(); textcolor(10); clrscr(); gotoxy(20,20); cout<<" L O G I N S U C C E S S F U L !!"<<endl; //Welcome Screen For Admin delay(1000); textcolor(14); clrscr(); gotoxy(1,20); for(i=0;i<52;i++) { delay(70); cout<<temp[i]; } delay(800); l: if(i==3) 28
  • 29. goto ex; textcolor(aj); textbackground(ai); clrscr(); cout<<"nt ADMIN'S MENUn"<<endl; delay(500); gotoxy(46,7); cout<<""T" TICKET initialising"; delay(500); gotoxy(52,13); cout<<""A""; cout<<" MOVIES running"; delay(500); gotoxy(47,19); cout<<""M""; cout<<" MODIFY menu "; gotoxy(20,19); delay(500); cout<<"colour SETTINGS "S""; gotoxy(16,13); delay(500); cout<<"BOOKING list "B""; gotoxy(21,7); delay(500); cout<<"EXIT as ADMIN "; cout<<""E""; gotoxy(43,13); c1=getche(); cout<<endl; clrscr(); if(c1=='t'||c1=='T') { a.tcrun(); } else if(c1=='s'||c1=='S') { settings(); } else if(c1=='a'||c1=='A') { cout<<"nThe Movies Running In IMAX are :"<<endl; delay(800); clrscr(); fout.open("mt.txt",ios::in); while(fout.read((char*)&a,sizeof(a))) { a.result(); } fout.close(); for(i=0;i<80;i++) cout<<"="; cout<<"nn"<<endl; i=0; cout<<"Press Any Key To Continue"<<endl; getch(); cout<<"nnRedirecting To ADMIN'S MENU "<<endl; 29
  • 30. p1=1; a.admn(); } else if(c1=='m'||c1=='M') { a.modify(); } else if(c1=='E'||c1=='e') { ex:goto g; } else if(c1=='b'||c1=='B') { cout<<"nBooking List "<<endl; u.showbooked(); a.admn(); } else { cout<<"Wrong Choice nEnter Again"<<endl; p1=1; admn(); delay(200); g:cout<<"Returning ....."<<char(24)<<endl; delay(1800); clrscr(); } } } void admin::modify() { c1='y'; while(c1=='y'||c1=='Y') { clrscr(); delay(400); cout<<"t tttMODIFYING MENU"<<endl<<endl; delay(400); cout<<"tttt"; cout<<" ADD movies "<<endl; cout<<"tttt"; cout<<" " A ""<<endl; delay(400); cout<<endl; cout<<"tttttt"D" DELETE movies " <<endl; cout<<endl; delay(400); cout<<endl; cout<<"tttt"; cout<<" " M " "<<endl; cout<<"tttt"; cout<<" EDIT movies "<<endl; delay(400); gotoxy(12,6); cout<<"ADMIN'S menu "E""<<endl; gotoxy(38,6); 30
  • 31. c2=getche(); gotoxy(30,15); if(c2=='a'||c2=='A') { add(); } else if(c2=='m'||c2=='M') { edit(); } else if(c2=='d'||c2=='D') { del(); } else if(c2=='e'||c2=='E') { goto mex; } else { cout<<"Wrong Choice"<<endl; } cout<<"nWant to continue modify"<<endl; c1=getche(); } if(c1=='n'||c1=='N') { mex:p1=1; admn(); } } void admin::settings() { i=0; int bk,tb; y:cout<<"Customize The Background Colour and Text Colour "<<endl; cout<<"Press 1 for Main Menu (Welcome Screen ) settings"<<endl; cout<<"Press 2 for Admin Menu settings"<<endl; cout<<"Press 3 for User Menu settings "<<endl; cout<<"Press 4 to return to admin's menu"<<endl; cin>>i;; if(i>4) { cout<<"WRONG CHOICE "<<endl; cout<<"Enter Again"<<endl; goto y; } if(i==4) { cout<<"Returning "<<char(24)<<endl; delay(400); i=0; p1=1; p=0; goto d; 31
  • 32. } cout<<"tt╔════════════════════════╗ "<<endl; cout<<"tt║number:color ║ "<<endl; cout<<"tt║ ║ "<<endl; cout<<"tt║ 0 = Black ║ "<<endl; cout<<"tt║ 1 = Blue ║ "<<endl; cout<<"tt║ 2 = Green ║ "<<endl; cout<<"tt║ 3 = Cyan ║ "<<endl; cout<<"tt║ 4 = Red ║ "<<endl; cout<<"tt║ 5 = Purple ║ "<<endl; cout<<"tt║ 6 = Yellow ║ "<<endl; cout<<"tt║ 7 = White ║ "<<endl; cout<<"tt╚════════════════════════╝ "<<endl; cout<<"nEnter the colour Number for Background colour "; cin>>bk; if(bk>7)bk=bk-1; cout<<"nEnter The Colour Number for Text Colour "; cin>>tb; cout<<endl<<endl; tb=tb+8; switch(i) { case 1: mi=bk; mj=tb; break; case 2: ai=bk; aj=tb; break; case 3: ui=bk; uj=tb; break; } cout<<" Applying Settings "; for(i=0;i<6;i++) { delay(500); cout<<"."; } cout<<"n Settings Have Been Applied"<<endl; delay(700); cout<<" Note: You Need To Exit As Admin"<<endl; getch(); p1=1; i=3; d:a.admn(); } void admin::add() //For Adding Movies into The List { cout<<"ADDING MOVIES "<<endl; fout.open("mt.txt",ios::out|ios::app); do { cout<<"nMovie Name "<<endl; 32
  • 33. gets(mname); cout<<"Language "<<endl; gets(mlang); cout<<"Rating "<<endl; cin>>mstars; cout<<"Description "<<endl; gets(mdes); cout<<"Actors "<<endl; gets(mactors); cout<<"Director "<<endl; gets(mdirector); cout<<"CBFC rating "<<endl; gets(mcbfc); cout<<"Timings"<<endl; gets(mtiming); cout<<"Price "<<endl; cin>>mprice; cout<<"Seats "<<endl; cin>>mseats; fout.write((char*)&a,sizeof(a)); cout<<"nDetails Entered Successfully"<<endl; cout<<"nWant to add more movies(y/n)"<<endl; c2=getche(); } while(c2=='y'||c2=='Y'); fout.close(); } void admin::edit() //For Editing The Added Movies { p=0; r=0; float pos; fin.open("mt.txt",ios::in); fin.seekg(0); i=0; cout<<"Movies In IMAX :"<<endl; while(fin.read((char*)&a,sizeof(a))) { delay(200); i++; cout<<i<<" "; cout<<char(14); cout<<" "<<mname<<endl; } fin.close(); r=0; fin.open("mt.txt",ios::in|ios::out); char name[20]; int nrating,nos; float nprice; char nname[20],ntim[20],ndes[10]; cout<<"n"<<endl; cout<<"Editing "<<endl; cout<<"Enter The Movie Number To be Edited(0 to Cancel Editting)"<<endl; cin>>r; 33
  • 34. if(r==0) goto k; i=0; fin.seekp(0); while(fin) { i++; pos=fin.tellg(); fin.read((char*)&a,sizeof(a)); if(i==r) { cout<<"Movie Foundn Details"; for(int h=0;h<6;h++) { delay(90); cout<<"."; } clrscr(); result(); cout<<"Now Edit"<<endl; cout<<"nnPress ! in any field to retain the old detail"<<endl; cout<<"Enter new Name: "; gets(nname); cout<<"Enter new Description: "; gets(ndes); cout<<"Enter new Timmings: "; gets(ntim); cout<<"Enter new Price: "; cin>>nprice; cout<<"Enter new rating(press 0 to retain old one): "; cin>>nrating; cout<<"No oF Seats"; cin>>nos; if(strcmp(nname,"!")!=0) strcpy(mname,nname); if(strcmp(ndes,"!")!=0) strcpy(mdes,ndes); if(mprice!=nprice) mprice=nprice; if(nrating!=0) mstars=nrating; if(strcmp(ntim,"!")!=0) strcpy(mtiming,ntim); if(nos!=0) mseats=nos; fin.seekg(pos); fin.write((char*)&a,sizeof(a)); fin.close(); p=1; break; } } if(p==0) { cout<<"Wrong Movie Number"<<endl; cout<<"Redirecting to modify menu"<<endl; 34
  • 35. delay(300); modify(); } fout.open("mt.txt",ios::in); cout<<"Now The Movies are.. :n"<<endl; delay(500); fout.seekg(0); clrscr(); while(fout.read((char*)&a,sizeof(a))) { result(); } fout.close(); for(i=0;i<80;i++) cout<<"="; cout<<"nn"<<endl; k:i=0; } void admin::result() //To Show Details Of A Movie { gotoxy(30,20); for(i=0;a.mname[i]!='0';i++) { delay(30); cout<<a.mname[i]; } cout<<" "; delay(200); gotoxy(31,21); cout<<a.mdes<<" "; gotoxy(27,25); delay(600); cout<<"DIRECTED by "<<a.mdirector<<" "; gotoxy(27,16); delay(500); cout<<"STARRING "<<a.mactors<<" "; gotoxy(4,19); delay(300); cout<<" LANGUAGE -"<<a.mlang<<" "; gotoxy(4,21); delay(300); cout<<" rating by CBFC-"<<a.mcbfc<<" "; gotoxy(4,23); delay(300); cout<<" ticket PRICE -"<<a.mprice<<" "; gotoxy(54,19 ); delay(300); cout<<a.mseats<<"("<<a.tick<<")" <<"- SEATS remaining"<<endl; gotoxy(54,21); delay(300); cout<<a.mstars<<" - STARS out of 5"<<endl; gotoxy(54,23); delay(300); cout<<a.mtiming<<"- TIMMING"<<endl; i=0; getch(); 35
  • 36. gotoxy(1,30); } void admin::del() //To Delete A Movie From List { p=0; i=0; r=0; fout.open("mt.txt",ios::in); fout.seekg(0); i=0; cout<<"Movies In IMAX :"<<endl; while(fout.read((char*)&a,sizeof(a))) { delay(200); i++; cout<<i<<" "; cout<<char(16); cout<<" "<<mname<<endl; } fout.close(); r=0; char dname[30]; fin.open("mt.txt",ios::in); fout.open("temp.txt",ios::out); cout<<"Enter The Movie Number to be deleted "<<endl; cin>>r; i=0; while(fin.read((char*)&a,sizeof(a))) { i++; if(i==r) { cout<<"Movie Detailsn"<<endl; delay(300); clrscr(); result(); p=1; cout<<"Are You Sure You Want To DELETE This Movie "<<endl; cin>>c1; if(c1=='n'||c1=='N') fout.write((char*)&a,sizeof(a)); } else fout.write((char*)&a,sizeof(a)); } if(p==0) { cout<<"Wrong Movie Number"<<endl; delay(500);cout<<"Returning "<<char(24); delay(1800); modify(); } if(c1=='y'||c1=='Y') cout<<"Movie Successfully Deleted"<<endl; fin.close(); fout.close(); 36
  • 37. remove("mt.txt"); rename("temp.txt","mt.txt"); fin.open("mt.txt",ios::in); cout<<"Now The Movies are :"<<endl; delay(900); clrscr(); while(fin.read((char*)&a,sizeof(a))) { a.result(); } fin.close(); cout<<"Press Any Key "<<endl; getch(); } void admin::tcrun() //To Run Ticket Counter/Initialise Tickets { i=0; cout<<"nProcessing Movies List ."; for(i=0;i<6;i++) { delay(300);cout<<"."; } cout<<endl<<endl; fout.open("mt.txt",ios::in); fout.seekg(0); i=0; while(fout.read((char*)&a,sizeof(a))) { delay(300); i++; cout<<i<<" "; cout<<char(14); cout<<" "<<mname<<" _ "<<mseats<<endl; } fout.close(); r=0; cout<<"nEnter the movie number to be initialised (0 to return)"<<endl; cin>>r; if(r==0) goto ex; fout.open("mt.txt",ios::in|ios::out); fout.seekg(0); i=0; int nseats; fout.seekg(0); while(!fout.eof()) { i++; pos=fout.tellg(); fout.read((char*)&a,sizeof(a)); if(i==r) { cout<<"nprocessing "<<mname<<endl; delay(400); 37
  • 38. cout<<"Enter The No of seats for the movie"<<endl; cin>>nseats; delay(300); cout<<"Initialising tickets with 0"<<endl; mseats=nseats; tick=0; fout.seekg(pos); fout.write((char*)&a,sizeof(a)); p=1; break; } } fout.close(); if(p==0) cout<<"Movie Not Found"<<endl; cout<<"redirecting"<<endl; delay(400); ex:cout<<"nReturning To Main Menu"<<char(24)<<endl; delay(1800); p1=1; admn(); } void admin::seatmanage(int s) //Function to Manage seats of a movie { //after booking ,cancelling and modifying.... file.open("mt.txt",ios::in|ios::out); while(!file.eof()) { pos=file.tellg(); file.read((char*)&a,sizeof(a)); if(strcmp(name,a.mname)==0) { a.tick=a.tick+s; a.mseats=a.mseats-s; file.seekg(pos); file.write((char*)&a,sizeof(a)); break; } } file.close(); } void admin::amtcal(int c3) { file.open("mt.txt",ios::in); while(file.read((char*)&a,sizeof(a))) { if(strcmp(name,a.mname)==0) { cout<<"Amount Payable :"; delay(300); cout<<c3; delay(400); cout<<"x"; delay(500); cout<<mprice; 38
  • 39. delay(500); cout<<" = Rs."; delay(900); float q; q=mprice*(c3); cout<<q<<endl; break; } } file.close(); } //End Of Functions Definition of class admin void user::umenu() //Funtion For User Module's Main Menu And Welcome Screen { textcolor(uj); textbackground(ui); clrscr(); if(p1==1) z:goto u; clrscr(); cout<<"tttt DEAR USER"<<endl; u:char temp[40]={"W E L C O M E T O "I M A X" "}; gotoxy(60,3); int x=70,y; for(i=0;i<45;i++) { x--; delay(70); gotoxy(x,3); cout<<temp; cout<<" " ; } cout<<endl; cout<<"ntttt USER'S MENU"<<endl<<endl; y=6,x=60; char book[]={"BOOK MOVIES"}; char modi[]={"MODIFY BOOKING"}; char canc[]={"CANCEL BOOKING"}; char exit[]={"EXIT AS USER"}; for(i=0;i<18;i++) { if(i%2==0) { y++; gotoxy(36,y); delay(70); cout<<book; gotoxy(36,y-1); cout<<" "; delay(70); gotoxy(36,40-y); cout<<exit; gotoxy(36,41-y); 39
  • 40. cout<<" "; } else { x-- ; gotoxy(70-x,20); delay(70); cout<<modi; gotoxy(69-x,20); cout<<" "; delay(70); gotoxy(x,20); cout<<canc; cout<<" "; } } delay(200);gotoxy(40,23);cout<<""E""; delay(200);gotoxy(x-4,20);cout<<""C""; delay(200);gotoxy(40,y+2);cout<<""B""; delay(200);gotoxy(x-17,20);cout<<""M""; time_t t; t = time(NULL); gotoxy(2,8);cout<<"DATE-"; gotoxy(8,8);cout<<ctime(&(t));gotoxy(18,8);cout<<" "; gotoxy(55,8);cout<<ctime(&(t));gotoxy(55,8);cout<<" TIME- "; gotoxy(71,8);cout<<" "; gotoxy(41,20); c1=getche(); gotoxy(39,28); if(c1=='e'||c1=='E') { goto f; } else if(c1=='b'||c1=='B') { p=0; cout<<"nBooking "<<endl; a:cout<<"Movies Now Playing in IMAX With Seat Numbers in ( )"<<endl; fin.open("mt.txt",ios::in); fin.seekg(0); i=0; cout<<endl; while(fin.read((char *)&a,sizeof(a))) { delay(500); i++; cout<<i; cout<<" "<<char(14); cout<<" "<<a.mname<<" ("; a.showseats();cout<<" )"<<endl; } fin.close(); r=0; cout<<"nEnter The Number to Book (0 to exit)"<<endl; cin>>r; 40
  • 41. if(r==0) { cout<<"Returning.."<<char(24)<<endl; delay(1800); clrscr(); goto z; } i=0; fin.open("mt.txt",ios::in); while(fin.read((char*)&a,sizeof(a))) { i++; if(i==r) { pos=fin.tellg(); strcpy(u.mov,a.mname); ubooking(); p=1; break; } } if(p==0) { cout<<"Wrong Movie Number ... Choose Once Again"<<endl; fin.close(); goto a; } } else if(c1=='c'||c1=='C') { u.ucancel(); } else if(c1=='M'||c1=='m') { u.uedit(); } else { cout<<"Wrong Choice"<<endl; cout<<"Enter Again "<<endl; umenu(); } f:cout<<endl; } void user::ubooking() { cout<<"Movie Details :"<<endl; delay(500); clrscr(); fin.seekg(pos); a.result(); strcpy(name,a.mname); fin.close(); gotoxy(40,40); cout<<"nMOVIE BOOKING "<<endl; 41
  • 42. cout<<"Enter Your name "<<endl; gets(uname); cout<<"Enter your age "<<endl; cin>>uage; cout<<"Enter the no. of tickets to be booked "<<endl; cin>>uno; cout<<"Enter your phone number or email id"<<endl; gets(uphone); cout<<"Want To confirm booking for ";puts(name); c2=getche(); if(c2=='y') { i=0; fout.open("mb.txt",ios::out|ios::app); cout<<"nYour Ticket number(s) are:"<<endl; tcallote(); cout<<"Your Main Ticket number is: "<<u.utc<<endl; a.seatmanage(u.uno); fout.write((char*)&u,sizeof(u)); a.amtcal(u.uno); delay(600); cout<<"nnT H A N K Y O U F O R B O O K I N G "<<char(1)<<char(2)<<endl; cout<<"Enjoy The Movie"<<endl; delay(80); cout<<endl<<endl; textcolor(ui+2); cputs("* NOTE :Use your Main Ticket Number Given Above");cout<<endl; cputs(" For Cancelling/Changing your Booking *");cout<<endl; fout.close(); cout<<"Press Enter To Continue"<<endl; ch=getch(); if(ch=='r') { cout<<"Redirecting to user menu"<<endl; cout<<char(24)<<endl; delay(1800); } umenu(); } if(c2=='n') { p1=1; umenu(); } } void user::tcallote() //Allocating Ticket Number After Booking a Movie { c2='n'; int cnt=u.uno; fstream f1; int tics; f1.open("mt.txt",ios::app|ios::in); while(f1.read((char*)&a,sizeof(a))) { 42
  • 43. if(strcmp(a.mname,name)==0) { tics=a.tick; while(cnt>0) { tics++; cnt--; cout<<tics<<endl; delay(300); } break; } } f1.close(); u.utc=tics; } void user::ucancel() // For Cancelling The Movie Booked { cout<<"Enter The Movie U booked for"<<endl; fstream f1; f1.open("mb.txt",ios::in); i=0; f1.seekg(0); while(f1.read((char *)&u,sizeof(u))) { i++; cout<<i<<" "<<char(13)<<" "<<mov<<endl; } r=0; f1.close(); f1.open("mb.txt",ios::in); f1.seekg(0); cin>>r;i=0; while(f1.read((char *)&u,sizeof(u))) { i++; if(i==r) { strcpy(name,mov); cout<<"nMovie selected :"<<name<<endl; } } f1.close(); cout<<"Canceling...."<<endl; cout<<"Enter Your Main Ticket Number "<<endl; cin>>r; fin.open("mb.txt",ios::in); fout.open("temp.txt",ios::out); while(fin.read((char*)&u,sizeof(u))) { if((r==utc)&&strcmp(name,u.mov)==0) { p=1; cout<<"FOUND"<<endl; cout<<"Name :";puts(uname); cout<<"Ticket No:"<<utc<<endl; 43
  • 44. cout<<"Movie :"<<u.mov<<endl; strcpy(name,u.mov); cout<<"CANCEL BOOKING????"<<endl; c2=getche(); if(c2=='n'||c2=='N') fout.write((char*)&u,sizeof(u)); } else { fout.write((char*)&u,sizeof(u)); } } if(c2=='y'||c2=='Y') { strcpy(name,mov); cout<<"Your Ticket Is Successfully Cancelled"<<endl; a.seatmanage((-u.uno)); } if(p==1&&c2!='y') cout<<"Your Ticket Is not Cancelled"<<endl; if(p!=1) cout<<"Not Found"<<endl; fin.close(); fout.close(); remove("mb.txt"); rename("temp.txt","mb.txt"); cout<<"Press Any Key"<<endl; getch(); canex:cout<<"Redirecting to User Menu"<<char(24)<<endl;delay(1800); umenu(); } void user::uedit() //For Changing The Details Of No. of Tickets,Contact Details { cout<<"Enter The Movie U booked for"<<endl; fstream f1; f1.open("mb.txt",ios::in); i=0; f1.seekg(0); while(f1.read((char *)&u,sizeof(u))) { i++; cout<<i<<" "<<char(13)<<" "<<mov<<endl; } cin>>r; f1.close(); i=0; f1.open("mb.txt",ios::in); f1.seekg(0); while(f1.read((char *)&u,sizeof(u))) { i++; if(i==r) { strcpy(name,u.mov); 44
  • 45. cout<<"Movie Selected :"<<name; } } f1.close(); float pos; int t; p=0; cout<<"nModify Your Booking "<<endl; fout.open("mb.txt",ios::in|ios::out); cout<<"Enter Your Ticket Number :"<<endl; cin>>t; int n; char cnt[30]; fout.seekg(0); while(fout) { pos=fout.tellg(); fout.read((char*)&u,sizeof(u)); if(t==u.utc&&strcmp(name,u.mov)==0) { cout<<"OLD DETAILS "<<endl; i=uno; cout<<"Name :"; puts(uname); cout<<"Movie :"; puts(a.mname); cout<<"Age :"<<uage<<endl; cout<<"No. of Tickets Booked :"<<i<<endl; cout<<"Contact info :"; puts(uphone); cout<<"nntEnter New Details"<<endl; cout<<"Enter Your Name "<<endl; gets(aname); cout<<"Enter the no. of tickects to be booked "<<endl; cin>>n; cout<<"Enter the contact details "<<endl; gets(cnt); if(strcmp(aname,"!")!=0) strcpy(uname,aname); if(strcmp(cnt,"!")!=0) strcpy(uphone,cnt); if(n!=0) uno=n; fout.seekg(pos); fout.write((char*)&u,sizeof(u)); fout.close(); p=1; break; } } if(p==0) cout<<"Not Found "<<endl; else { strcpy(name,u.mov); if(i>n) 45
  • 46. a.seatmanage((n-i)); if(n>i) a.seatmanage((i-n)); delay(300); cout<<"Details Saved"<<endl; } cout<<"Press Any Key"<<endl; getch(); cout<<"Redirecting to User Menu "<<char(24)<<endl;delay(1800); umenu(); } void user::showbooked() //Function Used by Admin To See Booked List { cout<<" B O O K I N G L I S T "<<endl; fin.open("mb.txt",ios::in); while(fin.read((char*)&u,sizeof(u))) { cout<<endl; for(i=0;i<70;i++) cout<<char(4); cout<<"nMovie Booked:"<<mov; cout<<"nName: "; puts(u.uname); cout<<"Ticket no:"<<u.utc<<endl; cout<<"Age :"<<u.uage<<endl; cout<<"No. Of Tickets: "<<u.uno<<endl; cout<<"Contact Details: "<<u.uphone<<endl; for(r=0;r<70;r++) cout<<char(4); getch(); } cout<<endl<<endl; for(i=0;i<80;i++) cout<<char(39); cout<<"End Of Booked List"<<endl; fin.close(); cout<<"Press Any Key To Continue"<<endl; getch(); cout<<"Returning to Admin's Menu"<<char(24)<<endl; delay(1000); p1=1; a.admn(); } //END OF PROGRAM 46
  • 48. 48
  • 49. if choice = ‘a’(admin module) 49
  • 50. if choice=’m’(modify menu) if choice=’a’(add movies) if choice=’d’(delete movies) 50
  • 51. Back to Admins menu & choice==’a’(movies running) back to admin’s menu &choice=’s’(settings) 51
  • 52. Back to welcome screen user’s menu 52
  • 54. if choice==’c’(cancelling booking) if choice=’e’(exit as user) 54
  • 56.  Bibliography  www.cplusplus.com  Help menu on turbo c++  Computer science with c++ (12th class text) 56
  • 57. Thank you 57
  • 58. 58