CIS-3050 Algorithms and Data Structures

Assignment 1

This assignment is to refresh your C++ and make sure that you are comfortable with templates.  It consists of rewriting an existing Array implementation that is specific for integer arrays into a template version of an array that can be used to store a variety of types.  To accomplish this, follow the steps below:
    1. Starting from the Array.cpp and Array.h code, rewrite the Array class into a templated version.  
    2. Once you think you've made the necessary changes, test your code by changing the driver.cpp test file to create Array<int>, rather than the existing Array. 
    3. After you have your Array<int> working (and only then), write a test driver that tests your implementation by using Array<string>.
    4. Lastly, write a user defined class, Person, which has a name and an age.  Write some tests that create an Array<Person>, and verify that it works. 

Some requirements:

I am assuming that you are all competent in C++, based on your previous course work.  You should all have access to previous C++ texts you have used.  Our text book also includes 2 chapters (1 and 2) on C++ topics.   You should use these resources (plus on line resources) first.   I will also be glad to answer questions as needed -- ask early and often! However, if you find that this assignment is totally beyond your scope of knowledge, please let me know as soon as possible.

As needed, I can be reached via email, AIM or in my office on the 2nd floor of the 700 building.  See my schedule page for my official office hours. I also anticipate being available during the afternoons until around 4p.  I do not expect to be at VTC on Monday, Sept. 6.    If you do need help, including your source code files in any email to me can be helpful and save time.

Some hints:
template<class T> class Array;
template<class T> ostream& operator<< ( ostream&, const Array<T> &  );
template<class T> istream& operator>> ( istream&, Array<T> & );

assuming that you used T for your template variable.  These three lines go before your declaration of the Array class in your .h file

Good Luck and Good Coding!