I have given you the following java files. (Get them here.)
Queue.java
and Stack.java
StackException.java
and QueueException.java
Node.java
TestStack.java
and TestQueue.java
(The a4files.zip contains all the .java files and this page, for easy downloading.)
You need to write 3 files. You may call these files whatever you want.
MyStack.java
-- this file implements Stack.java. You will use Node.java to implement the stack, and you will throw StackExceptions from here. When you are done, you can test to see if it works with TestStack.java
MyQueue.java
-- this file implements Queue.java. You will use Node.java to implement the queue, and you will throw QueueExceptions from here. When you are done, you can test to see if it works with TestQueue.java
StackQueueApplet.java
-- this file will be your applet file. You will use MyStack and MyQueue objects here, calling the methods you implemented. You will have to catch (but not throw) Stack and Queue Exceptions. (Do not use any Nodes in this class.)
Is something here unclear? Email me or Blanca.
~ztomasze Index :
TA Details: ICS211:
Assignment 4: Help http://www2.hawaii.edu/~ztomasze |
Last Edited: 29 Oct 2003 ©2002 by Z. Tomaszewski. |