Laboratory: Standard Template Library
The standard template library queue has the following routines:
type front() to display the front element of the queue.
type back() to display the back element of the queue.
bool empty() returning true if empty, else false.
void pop() killing off the front element of the queue (dequeueing).
void push( type & value ) placing the value on the real element
of the queue (enqueueing).
Write a menu driven program to instantiate (create) a queue of
float values as in
typedef queue< float > float_queue.
The menu must have the following choices:
1. to fill the queue with the number 1/2, 1/3,
, 1/9 beginning
2. dequeue front element and print it our to the screen.
3. enqueue a number given by the user
4. dequeue all the elements from the queue printing out all the
elements as they are dequeued
5. display the front and rear elements of the queue.
Your program's file name must be lab3.cpp
© Computer Science Department NSU.
Permission granted for non-commercial use only.