Movie ticket booking system


in this code i want the changes made in calculate function
to be reflected in the vectord made in classes show1 and show2… how to do that
problem statement is:
Problem Statement: – In a movie theatre 2 shows are running. You are given available seat of both show. There are some groups who want to book the tickets so first ask the show no. and then check whether seats are available or not if available then book their seats else ask them to enter seats again.
After each successful booking print total available seats and total booked seats.
Show 1:
Available seat:- A1, A2, A3, A4, A5, A6, A9

Show 2:
Available seat:- A1, A2, A4, A5, A6, B1, B3, B4, B5, B6, B7

Group1: -
Enter show no:- 1
Enter seats:- A1, A4

Print:- “Successfully booked”
Available seat:- A2, A3, A5, A6, A9
Booked Seat:- A1, A4

Group2:-
Enter show no:- 1
Enter seats:- A1, A3

Print : - seat A1 not available please try again.

Hey @nmaurya760
Your code is not even compiling ,why so ?
Also I would like you to share the source of this question to make sure that you are not asking questions from somewhere u are not supposed to Ask :slight_smile:


Please help me in implementing this question

Here I removed all the compilation errors : https://ide.codingblocks.com/s/359122

Now try to do the rest .


Calculate function is not working

Hey @nmaurya760
Its workin fine
try input
1
2
A1 A2

Use this conditions
instead of
if(idx)

           if(it!=s1.show1.end()){
           if(it!=s2.show2.end()){

Here did some work for you : https://ide.codingblocks.com/s/359150 :slight_smile:
Try to do the rest,I am always here to help :slight_smile:

Rest is my logic and way of correct in terms of the classes used and the functions made in object oriented design

Yes the logic is correct .

1 Like

Thank you so much for all the help😊

1 Like

@Kartikkhariwal1
can you provide the whole code for this.