I have a assignment that we are to write two clases (Ballot, Votes). We are to use an array of Ballot type to hold information for each particular Ballot. The Votes class is used to mark the ballots, count up all to votes, delete a ballot etc. I have the program working completley except for the resizing of the array of Ballots.
The list of ballots must be implemented with an array (i.e. of Ballot objects). This array must be dynamically allocated and must have the ability to resize, according to the following rules. There may be at most 10 unused array slots at any given time. This means that if and when it is necessary to allocate more space for the array, it cannot be more than 10 spaces at a time. This also means that if votes are deleted from the list so that the number of unused slots increases to more than 10, the array should be resized down, so that space is not being wasted. You should probably think about adding in one or more extra member functions to handle array resizing, and be sure to call upon such functions when necessary.
I'm stuck on ideas of how to go about doing this. Any help // ideas will be greatly apreciated.