LAB8 (20pts) - Stack ADT (array and linked implementation)
Purpose: The purpose of this lab is to explore the implementation and applications of a Stack ADT, using C++'s encapsulation and template mechanism. Two implementations, stack as array and stack as a list, are required.
This lab is found in your lab manual accessible through our Libraries --> Databases --> Safari Tech Books Online -->C++ Data Structures A Laboratory Course; a pdf copy of this lab is also found in your zip folder below.
You must work independently. If you need help, ask help from the instructor or TA, NOT colleagues.
Pre-lab: Implement methods for array and linked stack ADT.
- Carefully read pg. 71-72 in your lab manual. `
- Download the starting packet, Lab8.zip, for this lab, and use it to create a StackADT project. Complete the two implementations of the Stack ADT. Complete Test plan 6-1 on paper for both of your implementations of the Stack ADT .Provide pre and post conditions for all methods and include test cases in your pdf for all these methods.
- Stack Worksheets.pdf - if not handed to you, print this file and provide answers for the testing scenarios and add test cases as required in the lab manual.
- config.h - a header file used to turn debugging tests on and off
- Stack.h, StackArray.hpp, StackLinked.hpp - header for Stack ADT; definition and implementation files for two types of the Stack ADT.
- show6.cpp - code to complete the implementation of the method to display the Stack
- delimiters.cs - a stub program for the postlab exercise
- test6.cpp - the test driver for your implementation of the Stack ADT
Note: Start your work with a project that compiles. The instructor offered stubs for your functions to help you start your work with a project that compiles.
In-lab:
1. Finish implementing and testing the Stack methods. Get all test cases to pass.
2. If not done yet, complete Test plan 6-1 for both of your implementations of the Stack ADT.
3. Complete the Programming Exercise 3. Take and submit a snapshot of your output showing a similar ouput as this one (it shows my name and a passing and a failing test case).
Post-lab:
- Complete analysis exercise 1, part A only. You may use your software to try various cases, but submit your answers on paper (I shall grade your paper answer for this exercise.).
Submit your entire project as a zipfile (control-click on the folder and select Compress).
Grading:
- Text Worksheet.pdf: 5pts (2pts for tests and 3pts for the answer to your analysis exercise 1 part A)
- StackArray.hpp and StackLinked.hpp: 10pts (correctness of methods' implementation; have pre and post for all methods;)
- Programming Exercise 3: 5pts (1 pts is the picture)