Description
You will implement and test a sequence class that uses a dynamic array to store data items.
Purposes:
Ensure that you can write a small class that uses a dynamic array as a private member variable.
Before Starting:
1. Read all of Chapter 3 and 4.
2. Study the implementations of the sequence class using a fixed-sized array discussed in
chapter 3.2 and the bag class using a dynamic array in chapter 4.3.
How to Turn In:
Pack your files (source code only!) in a single WinZip file (Windows) or tar file (Unix/Linux)
and submit it through Blackboard. Please do not submit your executable files.
Files that you must write and turn in (Please do not turn in other files!!):
1. sequence2.h: The header file for the sequence class. Actually, you don’t have to write much of
this file. Just start with the textbook version
(https://www.cs.colorado.edu/~main/chapter4/sequence2.h) and add your name and other
information at the top. If some of your member functions are implemented as inline functions,
then you may put those implementations in this file too. There is a DEFAULT_CAPACITY
constant in the head file, which provides the initial size of the array for a sequence created by the
default constructor.
2. sequence2.cxx: The implementation file for the sequence class. You will write all of this file,
which will have the implementations of all the sequence’s member functions.
Other files that you may find helpful (please also include them in your submission):
1. sequence_test.cxx: https://www.cs.colorado.edu/~main/chapter3/sequence_test.cxx. The file was
originally written to test the sequence implementations using a fixed-sized array in Chapter 3.
You will need to make the following changes to make it work for your project:
Change
#include “sequence1.h”
to
#include “sequence2.h”
And change the statement
using namespace main_savitch_3
to
using namespace main_savitch_4
2. sequence_exam2.cxx: https://www.cs.colorado.edu/~main/chapter4/sequence_exam2.cxx A noninteractive test program that will be used to grade the correctness of your sequence class.


