Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Sharad Institute of Technology, Polytechnic | SY CO A

Micro-Project
Report
Title: Movie Ticket Booking.

Brief Description:-
Data Structures in C are used to store data in an organized and efficient manner. The C
Programming language has many data structures like an array, stack, queue, linked list,
tree, etc. A programmer selects an appropriate data structure and uses it according to
their convenience.
It is also used for processing, retrieving, and storing data. There are different basic and
advanced types of data structures that are used in almost every program or software
system that has been developed. So, we must have good knowledge about data
structures.
Data structure is mainly classified in two types as Linear Data Structure and Non-Linear
Data structure. In which Linear data structure is classified in following parts-
ARRAY-
An array is a collection of data of similar data type in which each element is stores
sequentially.
An array element can be accessed by its array index only.
STACK-
A Stack is the one of the most efficient non-primitive linear data structures.
Implementation of most of system is based on Stack data structure. Stack data structure
uses the principal of LIFO i.e., last in first out.
QUEUE-
A queue is linear list of elements in which insertion of a new element and deletion of
element takes at two different ends called Rear and Front respectively. Queue uses the
principal of FIFO i.e., first in last out.
LINKED LIST-
A Linked list is a collection of data item/elements in which each data is called as Node,
where the linear order of elements is maintained by means of pointer. A node in linked
list is basically has two fields in it as data field and next pointer field which does the
work storing the element and memory address of next element in it.

The non-linear data structure is basically classified in two types-


TREE-
A tree is a non-linear data structure used to represent data containing a hierarchical
relationship between elements. A tree is collection of a finite set of nodes in which a
specially designated node is called Root node and where remaining nodes are classified
into dis-joint sets where each of those sets in a tree.
GRAPH-
A Graph is a non-linear data structure consisting of vertices and edges. The vertices are
1
Sharad Institute of Technology, Polytechnic | SY CO A

sometimes also referred to as nodes and the edges are lines or arcs that connect any two
nodes in the graph. More formally a Graph is composed of a set of vertices (V) and a set
of edges (E). The graph is denoted by G (E, V).

Not only these types, but data structure has multiple types of itself or classified into
multiple types the above all data structures are mostly and commonly used in daily life.

Introduction:-
In this project , we have coded program as an example to represent “Movie ticket booking”.
As per our requirement we used structure.
Structure is user defined data type which stores different types of data. We used struct
movie which contains name, mobile No. and seat No. This project also contains linear
searching technic.

Customers can book movie tickets and view all of the movies playing in the cinema hall
through this project, which allows them to book tickets at any time and from anywhere.
The movie ticket reservation system was created with this in mind.

Providing customers with service to book a seat in the cinema hall and information about
the films at any time and from any location. The consumer may simply learn about the
movies that have been released and then make a decision. We will demonstrate our system
in this project by using the C programming language.

In this project, there are some options this are as follows:-


1) Book ticket.
2) View seats.
3) Find your seats.
4) Remaining seats.
5) Exit.

We used linear searching technic . it takes customer name as input and searches the name
in overall struct’s object.

2
Sharad Institute of Technology, Polytechnic | SY CO A

Aim of Project:

The aim of the project is to understand the concept of linear search by using
movie ticket booking system.

Course Outcomes Achieved:


 Performed linear search.
 We understood how the struct works.

Literature Review:

Data structures are one among the most fundamental concepts for a programmer. The
implementation phase of any project would start off by the decision of data structure to be
used. It gives an effective way for memory management and helps in analyzing the real-
world problems in a much simpler way.
Data structures are a conceptually demanding topic which confronts many Computer
Science students early in their course. The topic has a strong conceptual basis and often
proves difficult for many to grasp. A number of previous studies have examined that the
use of interaction and visualization within the systems can motivate a student to engage in
the learning process.

Actual Methodology Followed:


1. Formation of groups.
2. Selected topic for project.
3. Prepared proposal.
4. Collection of information.
5. Started programming.
6. After doing program prepared Project report.

3
Sharad Institute of Technology, Polytechnic | SY CO A

Actual Resources Used:

SR. Name of Resources Specifications Quantity Remarks


NO. /Material

1 Desktop Computer with Windows 11, 1 Yes


required specifications. 8GB RAM
Ryzen 5.
2 Software Turbo C++ 1 Yes

3 Browser Google Chrome 1 Yes

4 https://www.geeksforg
Websites eeks.com 1 Yes

Data Structure
Using C
5 By
Reference Books Techmax 1 Yes
Publication.

4
Sharad Institute of Technology, Polytechnic | SY CO A

Source code :-
#include <stdio.h>
#include <conio.h>
#include <string.h>

int i = 0, n = 0, a, total = 100,j=10;


char c[10], aa;
struct movie
{
int seat;
char mobile [12];
char name[20];
} m[100];
void bookm()
{
j--;
total--;
printf("\nEnter name = ");
scanf("%s", &m[i].name);
printf("\nEnter mobile no = ");
scanf("%s",&m[i].mobile);
printf("Booking successfully..!\n");
printf("\nName = %s", m[i].name);
printf("\nSeat no. = %d", i);
n++;
i++;
getch();
}
void display()
{
printf("\n");
if (total == 100)
{
printf("\n\nTheater is empty");
getch();
clrscr();
}
else
{
5
Sharad Institute of Technology, Polytechnic | SY CO A

printf("\n---------------------------------------------------------------------");
printf("\n\tSeat no.\t\tCustomer name.\t\tMobile no.\n");
printf("---------------------------------------------------------------------\n");
for (i = 0; i < n; i++)
{
printf("\t %d", i+1);
printf("\t\t\t %s", m[i].name);
printf("\t\t %s",m[i].mobile);
printf("\n");
}
}
}
void find()
{
char tmp;
if (total == 100)
{
printf("\n\nTheater is empty");
getch();
clrscr();
}
else
{
clrscr();

printf("\nEnter your name = ");


scanf("%s", &c);
for (i = 0; i < n; i++)
{
if (strcmp(m[i].name, c) == 0)
{
printf("\n\t\t\tYour seat no = %d", i);
printf("\n\t\t\tMobile = %s",m[i].mobile);
printf("\n");
break;
}
}
/* if (i == n)
{
6
Sharad Institute of Technology, Polytechnic | SY CO A

printf("\nEnter valid name");


printf("\nDo you want to enter name again ? Y/N\n");
scanf("%s", &tmp);
if (tmp == 'Y' || tmp == 'y')
{
goto a;
}
}*/
getch();
}
}
void remaining()
{
int a,b;
for(a=1;a<=10;a++)
{
for(b=1;b<=j;b++)
{
printf("%d\t",b);
}
printf("\n");
}
}
void main()
{
int ch = 1;
clrscr();
printf("\n\t\t\t*******************************");
printf("\n\t\t\t* *");
printf("\n\t\t\t* WEL-COME TO PVR CINEMAS *");
printf("\n\t\t\t* *");
printf("\n\t\t\t*******************************");

while (ch)
{
printf("\n\t\t\t\tM A I N M E N U\n");
printf("\n\t\t\t\t1.Book ticket\n\t\t\t\t2.View seats\n\t\t\t\t3.find your
seat\n\t\t\t\t4.Remaining seat\n\t\t\t\t5.Exit\n\t\t\t Enter your choice = ");
scanf("%d", &ch);
7
Sharad Institute of Technology, Polytechnic | SY CO A

switch (ch)
{
case 1:
bookm();
clrscr();
break;
case 2:
clrscr();
display();
getch();
clrscr();
break;
case 3:
find();
clrscr();
break;
case 4:
clrscr();
remaining();
/* printf("\n\t\t\tReamaining seats = %d", total);
printf("\n"); */
getch();
clrscr();
break;
case 5:
exit(0);
default:
printf("\nEnter valid");
}
}

getch();
}

END OF PROGRAM

8
Sharad Institute of Technology, Polytechnic | SY CO A

OUTPUT OF PROGRAM :

1) Main Window: –

2) Book ticket :-

9
Sharad Institute of Technology, Polytechnic | SY CO A

3) Displaying all seats :-

4) Finding Seat :-

5) View Remaining Seats :-

 Developed/Learning out of this Project:


o We got to knowledge about how linear search & struct
works.
o We used concept of linear searching.

 Applications of this Project:


o This micro-project is useful in understanding concept of linear search
and structure.
o This project can be used in movie ticket center.

10
Sharad Institute of Technology, Polytechnic | SY CO A

11

You might also like