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, myFirst and myLast to zero; and
- initialize myArray to the address of a dynamically allocated array of capacity items.