Serial number problem

Im in the midst of doing my C++ project that is ticket booking system.
I have encountered a small problem(at least now), that is i dont know how to keep the number running.
What i want to do is to define ticket #1-#100 belong to movie1 and so on.

My question is how do i need to define how the ticket number should run without making the program loop until the limit is reached. I try using For while and it keeps looping?

I also need to display the ticket number on the DOS output windows.
Last edited on
Your question is a bit unclear.

As you're developing a booking system, you must already be keeping track of movies and bookings. How are you storing this data??

Did you want ticket numbering to be per-movie. On are you allocating a block of ticket to one movie, and the following block to another? Etc.
I planned to store the ticket data in a ticketno file as .txt format.

Im allocating a block of ticket to each movie and followed by another block to another movie.

I also need to be able to recall back the ticket no in case the user need to edit their ticket info.
I assume that when you (re)start your program you load the file(s) back it and initialize an array (?) with the existing booking in. And you file must somehow store ticket no -> person.

So, assuming you're allocating tickets contiguously (no holes!), then you should know, after loading the file, the next free slot for a film.

I am also assuming that you're keeping the following data for each movie: name, ticket block start, ticket count, next free ticket (= tickets sold)
Last edited on
Topic archived. No new replies allowed.