DSIIProject Report Templete
DSIIProject Report Templete
Course Name
In
Specialization
Submitted by
SRM University–AP
Neerukonda, Mangalagiri, Guntur
Andhra Pradesh – 522 240
Nov, 2023
1. Introduction
The Movie Ticket Booking System is a C program designed to facilitate the booking
of movie tickets for different shows and movies. It provides an interactive interface
for users to view available shows, select movies, book tickets, and make payments.
2. Process
ALGORITHM:
User Interaction:
Users can view available shows and select the desired movie and show.
Seat selection allows users to choose the number of tickets and specific seats.
Payment options provide flexibility with Card, UPI, and Netbanking.
Confirmation messages and a summary of the booked tickets are displayed.
STEPS:
1.Two movies, "RRR" and "KGF," are available for booking.
2.Three show timings for each movie: 12:00 PM, 3:00 PM, and 6:00 PM.
3.Seat availability is displayed, allowing users to select and book seats.
4.Payment options include Card, UPI, and Netbanking.
5.Users can view available shows, book tickets, and exit the system.
3. Code
#include <stdio.h>
#include <stdlib.h>
1
#include <stdbool.h>
#include <string.h>
// Map ADT
typedef struct {
KeyValuePair entries[6];
} Map;
2
strcpy(map->entries[1].value, show1);
strcpy(map->entries[2].value, show2);
strcpy(map->entries[3].value, show3);
}
movie->seats[i][j] = false;
}
}
}
void displayShows() {
printf("\nMovies:\n");
printf("\nShows:\n");
for (int i = 1; i <= 3; ++i) {
printf("%d) %s\n", i, m[0].shows.entries[i].value);
}
}
3
printf(" ");
for (int j = 0; j < 10; ++j) {
printf("%d ", j + 1);
}
printf("\n");
void bookTickets() {
printf("\nChoose movie:\n");
for (int i = 0; i < 2; ++i) {
printf("%d. %s\n", i + 1, m[i].title);
}
printf("\nShows:\n");
4
for (int i = 1; i <= 3; ++i) {
printf("%d) %s\n", i, m[0].shows.entries[i].value);
}
int showChoice;
printf("\nEnter show choice: ");
scanf("%d", &showChoice);
displaySeats(screen);
int numTickets;
scanf("%d", &numTickets);
while (1) {
printf("Ticket %d: (row column): ", i + 1);
scanf(" %c %d", &rowindex, &col);
5
printf("Seat already occupied. Please try again.\n");
} else {
selectedMovie->seats[row - 1][col - 1] = true;
break;
}
}
printf("\n\n");
displaySeats(screen);
printf("Booked\n\n");
}
// Payment
enum PaymentOption {
CARD = 1,
UPI,
NETBANKING,
CANCEL
};
6
switch (payment) {
case CARD:
printf("Payment successful via card\n");
break;
case UPI:
printf("Payment successful via UPI\n");
break;
case NETBANKING:
printf("Redirecting to netbanking\n");
break;
case CANCEL:
printf("Payment canceled\n");
exit(0);
default:
printf("Invalid choice\n");
}
int main() {
printf("\nWelcome to MovieTicket");
7
char show1[] = "12:00 PM";
char show2[] = "3:00 PM";
char show3[] = "6:00 PM";
strcpy(m[0].title, movie1);
strcpy(m[1].title, movie2);
int choice;
while (1) {
printf("\n\n1. Display Available shows\n2. Book Tickets\n3. Exit\nEnter your
choice: ");
scanf("%d", &choice);
switch (choice) {
case 1:
displayShows();
break;
case 2:
bookTickets();
break;
case 3:
printf("\nHave a nice day\n");
exit(0);
8
default:
printf("Invalid choice\n");
}
}
return 0;
}
4. Results
9
10
5. Conclusion
Implement user authentication for a personalized experience.
Enhance error handling and input validation for robustness.
Extend the system to support additional movies, shows, and payment gateways.
Implement a database to store booking information for future reference.
11