/*! \file PolygonArrayList.cpp * \brief PolygonList subclass implementation * * \class PolygonArrayList * A subclass of the polygon list class, this subclass changes the * abstract class to utilize a single STL array container to house, manipulate, and display polygons. */ #include #include #include #include "PolygonArrayList.h" using namespace std; /*! * The default constructor initalizes the numShapes datamember to zero */ PolygonArrayList::PolygonArrayList() { numShapes=0; } /*! * the read into list function takes a filename as a string and reads in up to * ten polygon attributes from the file into the array. */ void PolygonArrayList::readIntoList(string filename) { ifstream source(filename.c_str()); int sides; double length; while (numShapes < 10 && source >> sides >> length) { Polygon P(sides,length); TheShapes[numShapes++]=P; } source.close(); source.clear(); } /*! * \fn * The printIteratively function uses the array indexes to print the contents of the * array. */ void PolygonArrayList::printIteratively() { cout<<"---------------------------------"<