Iterators

The goal of this lab is to give you a bit more experience with iterators. Complete the steps below:
  1. Create a new Project and add the following pieces of code to the project: student.h - student.cpp - iterator.cpp.
  2. Review and understand the MyVector class, the Iterator class, and the VectorIterator class (all in iterator.cpp).
  3. Complete the code fragment described in the comment at the bottom of the main function in iterator.cpp.
Email me (srollins@mtholyoke.edu) the following by Friday, 3/17/06 - 5pm.
  1. Attach your completed iterator.cpp.
  2. Explain what happens in the following line of code: itr->next()->print();. Be as specific as possible.
  3. How would you implement an Iterator class that had an array, instead of a MyVector, as its owner? You should provide a high-level discussion, an implementation is not necessary.

Sami Rollins