Dayaan M. answered 20d
Computer Science Graduate with Computer Engineering Coursework
The clue to what is going wrong is right there in your title. If you write a menu function like
void bookSeat(vector<int> status)
then C++ hands that function its own private copy of the vector. You mark the seat as booked inside the function, the function ends, the copy gets thrown away, and main is still holding all zeros. One ampersand is the whole fix:
void bookSeat(const vector<string> &seats, vector<int> &status)
Now the function is changing the same vector that main is holding, so the booking sticks. Anything that only reads, like displaying the seats or counting the open ones, can take const references and still be void, since it prints instead of returning a value.
For the setup, notice the problem is pointing you at two vectors that run in parallel. Use a nested loop over rows 1 to 5 and letters A to D so that seats holds 1A, 1B, 1C, 1D, 2A and so on, and build status as twenty zeros in that same order. The order is really the whole trick, because position i in seats always describes the same seat as position i in status.
Once they line up you never have to search the vector at all. If the user types the seat as a string s, then s[0] - '0' gives you the row number and s[1] gives you the letter, so
int index = (s[0] - '0' - 1) * 4 + (s[1] - 'A');
turns 1A into 0, 2A into 4 and 5D into 19. After that each menu option is only a few lines. Displaying all seats is a loop printing seats[i] and status[i], the available count is a loop counting the positions where status[i] is 0, booking is checking whether status[index] is already 1 before you set it, and cancelling is that same check in reverse. I would write just the display function with the ampersand first and confirm in main that the change actually shows up, because once that part clicks the other six options all follow the same shape.