The stub of our constructor should look like this:
ArrayQueue::ArrayQueue(unsigned capacity) {
}
The constructor should behave as follows:
- If capacity is not positive, throw a QueueException
with a suitable explanatory message;
- Otherwise:
- initialize myCapacity to capacity;
- initialize mySize and myFirstIndex to 0;
- initialize myLastIndex to capacity - 1; and
- initialize myArrayPtr to the address of a dynamically allocated array of capacity items.