Originally Posted by shabbir
What kind of error ?
Well, it seems like the DO while is not working properly.. When i enter y after 'do ya want to continue' it's forever looping...
btw, shabbir, i need your help on this assignment...
Write a program (YourName_queue.cpp) to implement a circular queue (max 5) to capture the taxis in a queue. Program should maintain the following information:
> License Number (max. 7 characters)
> Driver Name (max. 20 characters)
> Taxi Type (ie Comfort, CityCab, SMRT, Premier, Transcab)
Write a main program that display a menu of choices for user to perform the queue operations. You are to use an appropriate data structure to meet all requirements. Your program shall provide the following functions:
1. Initialize queue
2. Insert a taxi at back of queue
3. Remove a taxi in front of queue
4. Count number of taxis in queue
5. View all taxis in queue
6. View taxi types in queue
7. Is queue empty?
8. Is queue full?
1. Initialize queue. This option initializes/clears all items in the queue.
2. Insert a taxi at back of queue. If the queue is not full, program will prompt user to enter the taxi license number. It checks if the taxi already exists in queue. If yes, display error message, else prompt user to enter other taxi’s info and insert into the queue.
3. Remove a taxi in front of queue. If the queue is not empty, program will delete the taxi in front of the queue.
4. Count number of taxis in queue. This option will display the total number of taxis in the queue.
5. View all taxis in queue. This option will display all the taxis’ info in the queue, starting from the first taxi in front of the queue to the last taxi at the rear of the queue.
6. View taxi types in queue. This option will display the breakdown of the taxi types in the queue, ie the number of Comfort, CityCab, SMRT, Premier & Transcab. Assignment 3 Page 2
7. Is queue empty? This option checks whether the queue is empty and print an appropriate message.
8. Is queue full? This option checks whether the queue is full and print an appropriate message.
9. Quit. End the program.
Note: You can assume user will always start the program and initialises the queue (i.e. invoke option (1) first prior to any operations.
If ya got free time, try this program.. thanks..