
CS 1316 – Homework 7 – Quack / Ring Buffer
Due: Wednesday July 1st, 2009 before 6pm.
Out of 100 points
This is an individual assignment. You may collaborate with other students in the class but
your solutions must be your own. Collaboration means talking through problems,
assisting with debugging, explaining a concept, etc. You should not exchange code or
write code for others. Collaboration at a reasonable level will not result in substantially
similar code.
Homework 7: Implementing a Quack using a RingBuffer
Part 1:
For this assignment, you will be completing several methods in the (currently
incomplete) RingQuack.java class file. Specifically, you will fill in the implementation
of:
•void enqueue( E element)
•void push( E element)
•E pop()
•E dequeue()
The specifications and behavior for each method in this assignment are located in the
Javadoc comments inside the incomplete RingQuack.java class file. There are several
completed methods in addition to the ones that you need to implement. It is your task to
implement each of the missing methods.
While implementing the above methods, you may not use any methods from java.util or
any other Java libraries.
NOTE: The Quack.java interface is using Java Generics, so that your Quack can contain
objects of any type. The main() method in the RingQuack.java file instantiates an object
of type RingQuack that can hold Strings, but your code should work with any objects
stored within the list.