DSA Mini Project
DSA Mini Project
DSA Mini Project
Implement a movie ticket booking system where customers can view available
seats, book tickets, and cancel reservations. Use 2D arrays to represent
the seating arrangement of the theatre and linked lists to handle ticket
booking records*/
#include<iostream>
using namespace std;
class node{
public:
node* prev;
char data;
node* next;
}
};
}
h->next = head;
head->prev =h;
}
}
else{
head->data = 'X';
cout<<"Seat is booked"<<endl;
}
}
int main(){
cout<<"Seating arrangement is as follows:"<<endl;
node* heads[10] = {NULL};
for(int i=0; i<10; i++){
make_array(heads[i]);
print(heads[i]);
}
cout<< "Menu: \n1) Book a seat \n2) Cancel booking \n3)Show seating
\n4)END"<<endl;
while(1){
int a;
cout<< "Option of your choice:";
cin>> a;
int r,s;
if(a==1){
cout<<"\nEnter row & seat number to be booked(format: row
column):- ";
cin>>r>>s;
book_seat(heads[r-1],s,'X');
}
else if(a==2){
cout<<"\nEnter seat to be canceled(format: row column) :- ";
cin>>r>>s;
cancel_seat(heads[r-1],s);
}
else if(a==3){
cout<<"===============================================\n";
for(int i =0;i<10;i++){
print(heads[i]);
}
cout<<"===============================================\n";
}else{break;}
}
}
OUTPUT: