Needs to be done by TOMMOROW NIGHT.
Implement the two classes using the descriptions given by me.
○ The two collections that you build will store data of type int.
○ You need to include pre and post conditions comments above each method. They are provided with the
class descriptions below but you should write them in your own words.
○ You must store the values that are added to these collections in private arrays called, “store”.
Each class will have one.
○ You must automatically resize the array if it gets full.
■ When resizing, simply create a new array of double the previous size.
■ Write a separate private method for resizing.
■ Resizing should only happen when adding an int and only when the array is full.
○ The stack and queue will require exception classes called, “EmptyStackException” and
“EmptyQueueException” respectively. These classes are provided with this assignment.
● Create two UML Class diagrams, one for ArrayStack and the other called ArrayQueue.
○ You will need to use a program that enables you to do such modeling.
○ There are free programs available, Microsoft Visio (available through school), or you can use a
○ Whatever program you decide to use, You should submit two PDF files, one called
[login to view URL] which contains the diagram of the ArrayStack class, and the other called
[login to view URL] for the diagram of the ArrayQueue.
○ Do not copy these diagrams from the internet.
● Implement a class called Main in which you will create the main method to test your two collections.
○ The main method will consist of only method calls.
○ You will write a test method for each test and call it from main.
○ Each test method should test only one method of a collection
○ Test every method of each collection.
○ Feel free to write as many helper-methods as you wish.
○ There will not be any need for a user interface in this program.
● Each test method will test the functionality of only one feature (method) of a collection and report whether it
works or not.
○ The output of each test should include:
■ The name of the class under test
■ An explanation of what was tested. This output string should be stored in a variable and be the
first statement in the method.
■ Whether the test passed or failed
○ Please organize this class in an orderly way.