class NaiveQueueOfCustomers {

    // There are many naive implementations!
    // This one assumes waiting[0] is the head
    // So removal means shifting everyone else up the array
    
    private Customer[] waiting;
    int length;
   
    public NaiveQueueOfCustomers(int capacity) {
        waiting = new Customer[capacity];
    }

    public void insert(Customer cust) {
        if (length == waiting.length) {
            return;
        }
        waiting[length] = cust;
        length = length + 1;
    }

    public void remove() {
        if (length == 0) {
            return;
        }
        for (int i = 1; i < length; i = i + 1) {
            waiting[i - 1] = waiting[i];
        }
        length = length - 1;
        waiting[length] = null; // not strictly necessary
   }

    public Customer getFront() {
        if (length == 0) {
            return null;
        }
        return waiting[0];
    }

    public boolean isEmpty() {
        return length == 0;
    }

    public boolean isFull() {
        return (length == waiting.length);
    }

    public int length() {
        return length;
    }

    public String toString() {
        String s = "Queue: [ ";
        for (int i = 0; i < length; i = i + 1) {
	        s = s + waiting[i] + " ";
        }
        s = s + "]";
        return s;
    }
}
