Project 2

Requirements:

In this project, you will implement two classes:

  1. Resizable deque: Resizable_deque.

A skeleton header files for these classes is provided with the associated class. You may modify these files for the project, though you must add your own comments. Do not copy text from the specifications. Testing tools for some of the classes provided in the associated testing directory. Included is a simple exception header file which contains two classes, underflow and overflow which are thrown by some of the member functions.

Failure to satisfy the stated run times will result in a mark of 0.

You are required to submit within your gzipped tar file the following header files:

  • Resizable_deque.h

Be sure to read the instructions on the Projects page with regard to the submission of projects.

The commands is:

$ tar -cvf uwuserid_p2.tar Resizable_deque.h
$ gzip uwuserid_p2.tar

Be sure to read the instructions on the Projects page with regard to the submission of projects.

Runtime

The run time of each member function is specified in parentheses at the end of the description. In some cases, the run-time requirements are expressed as amoritized run-time requirements.

Comments

You are expected to comment your code. At least 20% of your source code must be in the form of valid and informative comments. As you will use this class in future projects, it is advisable to comment it appropriately. You are also expected to comment the provided bare header files.

Testing

One test file is provided, however, it is by no means a complete.

Testing Strategies

In this case, there are multiple boundary conditions: when the list empties, when the array is 1/4 full, when it is empty, and when the array is full. Each function should be tested with function class which cause it to manipulate both an empty lists and arrays and non-empty list and arrays.

Look at each function which has an if statement. Try to create a sequence of instructions which cause the conditional statent to evaluate to true. Next, do the same thing, however, create a sequence of instructions which will cause the conditional to evaluate to false.

What are other possible scenerios which could cause your classes to fail?

Testing Example

Rather than immediately starting with the *Driver.cpp program, it is probably a lot easier to write a small int main() function which you can build up. Each time you implement a function, add a function which tests it.

A smaller routine like this would allow you to make full and effective use of the debugger: you can easily track what is occuring. Notice how I test some of the functions, but not all, based on the order in which I would implement them.

Check List

Have you:

  • Have you named the file correctly? (uwuserid_p2.tar.gz where uwuserid is your UW User ID, i.e., your login name.)
  • Are you submitting a gzipped tar file? (Not a rar nor a zip.)
  • Is the gzipped tar file not corrupt?
  • Does your submission contain the files listed above?