CSCI 151 - Data Structures and Object-Oriented Development
Spring 2015
Lab 5: Array implementation of stacks
- In this lab, we will develop an array implementation of
stacks.
- Download the provided code.
- Unpack the code into a new Eclipse Java project.
- The code includes the following files:
-
numstack package
-
StackViewer.java: Run this program to get an interactive view of your stack.
-
numstack.model package
-
ArrayIntStack.java: This is the only file you will modify for this assignment. You will use an array of integers to implement a stack.
- If you use
ArrayList you will receive no credit for the assignment.
-
IntStack.java: This is a general interface for a stack
of integers. You will want to call popNotEmpty() and
peekInRange() at the right places, to ensure the
appropriate methods fail when necessary.
-
IntStackTest.java: These are the unit tests for your
stack. Your grade depends on passing these tests.
-
ArrayIntStackTest.java: Run this file to see the
results of the unit tests for your ArrayIntStack
implementation.
Grading
| Number of Unit Tests Passed | Grade |
| 7 | A+ |
| 6 | B |
| 4 | C |
| 3 | D |