Professional Documents
Culture Documents
(Deemed to be University)
2200032832 : A. Poojasri
2200032865 : G .SOWMYA
2200033055 : M.SRIBASIVIREDDY
2200033060 : K.TEJASWI
DR.M.BHASKAR
Associate Professor
KL UNIVERSITY
Green fields, Vaddeswaram – 522 302 Guntur
Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES-1
CERTIFICATE
2
ACKNOWLEDGEMENTS
I express the sincere gratitude to our principal Dr. A. Jagadeesh for his
administration towards our academic growth.
I express sincere gratitude to HOD-BES-1 Dr. D. Haritha for her leadership and
constant motivation provided in successful completion of our academic semester.
I record it as my privilege to deeply thank for providing us the efficient faculty and
facilities to make our ideas into reality.
3
ABSTRACT
4
INDEX
5 Algorithm 9
6 Flowchart 10
7 Implementation 11-19
9 Conclusion 25
5
1.INTRODUCTION
What is a Movie booking system?
Online Movie Ticket Booking System provide another way for the customers to buy
cinema ticket. This system reduces work load on customers, it is an automatic ticket
booking system. This system is basically aimed to provide complete information of
the movie and schedule to the customer, according to which he/she can book the
tickets.
MBS can be installed in movie theatres, action theatres, or any show organising events
in order to manage ticket booking and all other stuff in an organised manner.
A MBS can basically help a user to book tickets easily and help the theatre owners to
organise booking in a proper manner.
The key features of MOVIE BOOKING SYSYTEM project in C are briefly described
below:
Consider a file of seat numbers information for a screen. The program should be able
to allocate and deallocate storage memory for the seat’s records. The file should have
the following information field: the ticket number,name of the customer 1) seat
number
2) customer name(booking person name) by using this type of program with out no
mistakes we can store data very quick and to search any seat’s details.
6
2.AIM
This project will help you to understand file handling in C i.e. creating a file
and accessing the stored data in the file, modifying and removing the stored
data. It will also help you to understand the use of functions as well as
different parameters of C programming language.
Advantages: -
• Easily accessible and just requires basic computer knowledge for usage.
Disadvantages: -
• Cannot support the huge data
Future enhancements: -
This code is a very basic form of the system. Using more complex functions
one can add more options to the selection process, and proper web based
application can also be developed for easier accessibility and more
convenience.
7
3. SYSTEM REQUIREMENTS
SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows: Language
: Turbo-C
Operating system:Windows Xp or later.
HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:
RAM : 8GB
Processor : i3 or i5
8
4.ALGORITHM
Step 1: Start
• Book ticket
• Cancel ticket
• Quit
Step 3: if select option book ticket then we should fill following field
• Seat number
• Booking….
Step 4: choose seat
9
5.FLOWCHART
10
6.IMPLEMENTATION :
#include<stdio.h>
#include<stdlib.h>
#include"moviedetails.c"
#include"decleration.c" #include<strings.h>
struct moviedetails person[300]; int count=0; int id2=1000; int main()
{
int **seat,choice,price=500,slection,i;
seat=(int **)calloc(101,sizeof(int *));
for (i=0;i<3;i++)
*(seat+i)=(int *)calloc(101,sizeof(int ));
int x;
while(x!=3)
{
choice=choice1();
switch(choice)
{
case 1:
slection=movie();
reservation(seat[slection-1],price,slection);
count++;
break;
case 2:
slection=cmovie();
cancel(seat[slection-1]);
break;
case 3:
x=3;
break;
default:
printf("Choice not available\n");
break;
}
}
}
void reservation(int *array,int price,int slection)
{
11
int i,j;
printf("\n SCREEN\n\n\n");
for (i=1;i<=100;i++)
{
if (array[i]==0)
printf("%d\t",i);
else
printf("*\t",i);
if(i%10==0)
printf("\n\n");
}
printf("Please enter your name: ");
scanf(" %19[^\n]%*[^\n]",&person[count].name);
printf("Please enter your phone number: ");
scanf("%u",&person[count].phone);
printf("Which seat number you want? ");
scanf("%d",&j);
if (j>100||j<1)
{
printf("seat1 number is unavailable in this theater\n");
printf("Please re-enter seat number: ");
scanf("%d",&j);
}
if (array[j]==1)
{
printf("Sorry, this ticket is already booked! Please choose
another seat.\n");
scanf("%d",&j);
}
else
array[j]=1;
person[count].seat=j;
if (slection==1)
ticket1(j,person[count].name,id2,price);
else if (slection==2)
ticket2(j,person[count].name,id2,price);
else
ticket3(j,person[count].name,id2,price);
id2++;
12
}
int choice1(void)
{
int choice;
printf(" Simple Movie Ticket Booking System\n");
printf("
==========================================================
========\n");
printf("|| 1- To puchase ticket: ||\n");
printf("|| 2- To cancel the seat: ||\n");
printf("|| 3 - Exit system: ||\n");
printf("||=======================
============================||\n"); printf(" Enter your choice:");
scanf("%d",&choice);
return choice;
}
void cancel(int *array)
{
int Cseat,i,stop;
printf("Please enter ID number of ticket: ");
scanf("%d",&Cseat);
for (i=0;i<300;i++)
{
if(Cseat==person[i].id)
{
stop=5;
system("cls");
printf("%s your seat is %d
cancelled",person[i].name,person[i].seat);
array[person[i].seat]=0;
i=300; }
}
if (stop!=5)
printf("Ticket ID number is incorrect please enter right one to cancel ticket:
\n");
}
void ticket1(int choice,char name[10],int id2,int price)
{
system("cls");
13
printf("\n\n");
printf("\t-----------------THEATER BOOKING TICKET----------------\n");
printf("\t================================================\n");
printf("\t Booking ID : %d \t\t\tShow Name : Avengers: EndGame\n",id2);
printf("\t Customer : %s\n",name);
printf("\t\t\t Date : 29-04-2019\n");
printf("\t Time : 08:00pm\n");
printf("\t Hall : 02\n");
printf("\t seats No. : %d \n",choice);
printf("\t price . : %d \n\n",price);
person[count].id=id2;
printf("\t=========================== =========\n");
return;
}
void details(void)
{
int i; char pass[10],pak[10]="pass";
printf("Enter the password to see details: ");
scanf("%s",&pass);
if (strcmp(pass,pak)==0)
{
for (i=0;i<count;i++)
{
printf("seat no: %d is booked by %s booking id is
%d\n",person[i].seat,person[i].name,person[i].id);
}
}
else
printf("Entered password is wrong \n");
system("PAUSE");
system("CLS");
}
Int movie(void)
{
int i;
system("cls");
printf("\t\t\twhich movie you want to see?\n");
14
printf("\t\t\t----------------------------\n\n");
printf("\t\t\tpress 1 for Avengers: EndGame\n\n");
printf("\t\t\tpress 2 for Captain Marvel\n\n");
printf("\t\t\tpress 3 for Spider-Man: Far From Home\n");
scanf("%d",&i);
system("cls");
return i;
}
void ticket2(int choice,char name[10],int id2,int price)
{
system("cls");
printf("\n\n");
printf("\t-----------------THEATER BOOKING TICKET----------------\n");
printf("\t====================================================\n");
printf("\t Booking ID : %d \t\t\tShow Name : Captain Marvel\n",id2);
printf("\t Customer : %s\n",name);
printf("\t\t\t Date : 15-04-2019\n");
printf("\t Time : 09:00pm\n");
printf("\t Hall : 03\n");
printf("\t seats No. : %d \n",choice);
printf("\t price . : %d \n\n",price);
person[count].id=id2;
printf("\t========================================================\n");
return;
}
int cmovie(void)
{
int i;
printf("\t\t\twhich movie ticket you want to cancel\n");
printf("\t\t\t-------------------------------------\n");
printf("\t\t\tpress 1 for Avengers: EndGame\n\n");
printf("\t\t\tpress 2 for Captain Marvel\n\n");
printf("\t\t\tpress 3 for Spider-Man: Far From Home\n");
scanf("%d",&i);
return i;
15
}
void ticket3(int choice,char name[10],int id2,int price)
{
system("cls");
printf("\n\n");
printf("\t-----------------THEATER BOOKING TICKET----------------\n");
printf("\t=================================================\n");
printf("\t Booking ID : %d \t\t\tShow Name : Spider-Man: Far From Home
\n",id2);
printf("\t Customer : %s\n",name);
printf("\t\t\t Date : 5-07-2019\n");
printf("\t Time : 10:00pm\n");
printf("\t Hall : 04\n");
printf("\t seats No. : %d \n",choice);
printf("\t price . : %d \n\n",price);
person[count].id=id2;
printf("\t================================================\n");
return;
}
16
7.RESULTS AND SCREENSHOTS
17
Purchasing a ticket :
Enter 1
Choose movie
Suppose 2 is choosed
18
Customer details have to be entered
Name
Phone number
Seat no. to be choosed
This is the final ticket that has been booked according to the
details given by the user.
If the chosen seat is already booked previously the output will be:
Incase the user has to cancel the booked ticket on pressing 2 he/she would
be asked about the movie and booked ticket ID
19
20
8.CONCLUSION
So after successful execution of the code in c language it can be concluded
that with proper usage of functions and keywords in c different types of
systems could be developed for example the Movie Booking System which
was coded and the respective outputs were brought out to print the ticket
with user’s details .
21
22
23