Computer Science Investigatory Project: Theatre Management
Computer Science Investigatory Project: Theatre Management
Computer Science Investigatory Project: Theatre Management
INVESTIGATORY PROJECT
THEATRE MANAGEMENT
Submitted by:
Ayushi Shakya
XII-A
CERTIFICATE OF COMPLETION
This is to certify that
THEATRE MANAGEMENT
herself and under my guidance.
DECLARATION
I hereby declare that the project work entitled
Theatre Management, submitted to Department of
Computer Science, Kendriya Vidyalaya Andrews Ganj,
New Delhi is prepared by me. All the coding is result
of my personal efforts.
Ayushi Shakya
XII-A
ACKNOWLEDGEMENT
I would like to express my special thanks of gratitude to
my teacher Mr. Atul Verma as well as our principal Mrs.
Rashmi Mishra who gave me the golden opportunity to do
this wonderful project on the topic theatre management,
which also helped me in doing a lot of Research and i came
to know about so many new things I am really thankful to
them.
Secondly i would also like to thank my parents and friends
who helped me a lot in finalizing this project within the
limited time frame.
Ayushi Shakya
XII-A
HEADER FILES
IOSTREAM.H : to implement cin and cout statements.
FSTREAM.H : for file handling
CONIO.H : for clrscr() function
PROCESS.H : for exit() function
STDIO.H : for gets(), puts() functions
STDLIB.H :
STRING.H : for strcmpi() function
WORKING DESCRIPTION
CODING
#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<process.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
fstream file;
class Theatre
{
char MID[6];
char MovName[31];
char code[4];
char rating[6];
char cast[51];
double Price;
char dura[21];
char Dir[21];
char show[21];
public:
void Enter();
void Search();
void Ticket();
double TotalPrice(int);
void Modify();
void Display();
void Delete();
} MOV;
void main()
{
char ch;
int choice;
do
{
clrscr();
cout<<"\n\t ========= MOVIE RESERVATION =========\n";
cout<<"\n\t 1:-> ENTER A MOVIE \n\t 2:-> SEARCH FOR A MOVIE \n";
cout<<"\t 3:-> PURCHASE TICKETS \n\t 4:-> MODIFY DETAIILS \n\t";
cout<<" 5:-> DELETE A MOVIE \n\t 6:-> DISPLAY \n\t 7:-> EXIT PROGRAM \n";
cout<<"\t =====================================" ;
cout<<"\n\n\t Enter your choice : ";
cin>>choice;
switch(choice)
{
case 1: file.open("Movie.dat", ios::out | ios::binary | ios::app );
MOV.Enter();
file.write((char*)&MOV, sizeof(MOV));
file.close();
break;
case 2: MOV.Search();
break;
case 3: MOV.Ticket();
break;
case 4: MOV.Modify();
break;
case 5: MOV.Delete();
break;
case 6: file.open("Movie.dat", ios::in | ios::binary);
while(file.read((char*)&MOV, sizeof(MOV)))
{
MOV.Display();
}
file.close();
break;
case 7: cout<<"\tPROGRAM TERMINATED";
exit(0);
break;
default: cout<<"\t Wrong Choice ! \n\t ABORTING !!!";
}
cout<<"\n\n\t Want to enter more? (y/n/Y/N): ";
cin>>ch;
} while(ch=='y'|| ch=='Y');
}
void Theatre:: Enter()
{
cout<<"\n\n\t Movie id : ";
cin>>MID;
cout<<"\n\t Enter movie name : ";
gets(MovName);
cout<<"\n\t Content code : ";
cin>>code;
cout<<"\n\t Rating : ";
cin>>rating;
cout<<"\n\t Director : ";
gets(Dir);
cout<<"\n\t Cast : ";
gets(cast);
cout<<"\n\t Duration : ";
gets(dura);
cout<<"\n\t Show timings : ";
gets(show);
cout<<"\n\t Ticket cost : ";
cin>>Price;
}
void Theatre:: Search()
{
file.open("Movie.dat", ios::binary | ios:: in);
int found=0;
char temp[5];
cout<<"\n\n\t Enter the movie id to be searched : ";
cin>>temp;
while(file.read((char*)&MOV, sizeof(MOV)))
{
if(strcmpi(temp,MID)==0)
{
found=1;
MOV.Display();
}
}
file.close();
if(found==0)
cout<<"\t Movie id : "<<temp<<" does not exist";
}
double Theatre:: TotalPrice(int no)
{
return no*Price;
}
void Theatre:: Ticket()
{
char date[11], cname[21], mname[21];
int num;
cout<<"\n\t Enter date : ";
cin>>date;
cout<<"\t Enter customer name : ";
gets(cname);
Display();
}
}
file.close();
}
OUTPUT
1. HOMESCREEN
5. DELETE A MOVIE
7. EXIT PROGRAM
BIBLIOGRAPHY
Computer science with C++ by Sumita Arora
www.google.com
en.wikipedia.org
Object oriented programming by Robert Lafore