COSC 1436 Lab 14

Purpose: In this lab you will be implementing a stack class and be using the stack class for for a parentheses checking application.

Due: Before class on May 7, 2013


1. Implement the stack class as has been discussed in lecture. The type of data to be stored in this class is an int. Build a driver program to verify this works properly. The program should have a class .h file (that contains both the class information and implementation), and a driver file that you used to test the class. Your class should include the following methods:

2. Modify your stack class so that it now uses a template that will allow it to handle multiple data types. You should also add to your class a copy constructor, and overload the assignment operator, equals operator, and not equals operator. The type of data to be stored in this class will be determined at run-time. Build a driver program to verify this class works properly, it should verify that your class now works properly with integers, floats, abstract data types (make a small class and store it on the stack), and chars (but not c-strings). The program should have a class .h and a driver file that you used to test the class.

3. After your stack class is working properly, now use the stack class to assist to determine whether you have balanced or unbalanced parenthesis. You will be completing programming challenge 14 from Gaddis chapter 18 (pg. 1104, 6th Edition or pg. 1099, 7th Edition), using your templated stack class.

4. Prepare a lab report/documentation package. All of these items do not need to be in the same file or word document, but the main lab report file must reference each item by name. The lab report must includes the following information:

  • Your Name
  • Purpose of this program.
  • Program psuedocode is not required for this lab.
  • Program source code
  • Program output (on disk)
  • How was this program tested
  • What problems/successes did you have with this program?
  • An estimate of how much time you spent working on this lab

4. Submit your lab via Blackboard.

Grading Criteria: 100 points available for this lab.
  • The lab grader will be using this grading criteria to grade your two programs. The points will then be scaled to the available points.
  • Here is a C++ style guide from Dr. Fernandez that should assist you in coding your program. Style guide.
  • 100 points if all of the above requirements are met.