Originally posted by Smita Chopra:
Thanks for you input.
But what if second..third...tenth person comes and asks for a ticket. You'll have to see which all seats have been filled. Of the vacant seats you'll have to look for consecutive seats. If consecutive seats are not available you'll have to assign them dispersed seats and update your list of filled seats.
Thanks
In that case, you take what I've already done and then while you're looping through each row, you check for consecutive numbers like this:
If NumberOfTicketsRequested <=5 then
...Loop through row
......If seat[row][seat] is vacant then
.........If seat[row][seat - 1] is vacant then
............counterConsecutive++
.........End if
......End if
...End loop
If counterConsecutive >= NumberOfTicketsRequested then
...// find a way to identify the first seat found in a
string of consecutive vacant seats found
End If