Objects with Dynamically Allocated Members

  1. List with Classes, Testing.

    Create a project titled Lab11_ListTest. Implement the List of doubles described in the previous lab as a class List. You should use this class definition. The class attributes are a pointer to the dynamically allocated array list_ and the array size size_ This class contains two groups of methods:

    To reduce the amortized cost, your code should use a geometric expansion strategy. This means that each time an element is added to the array, the array should double in size. If the number of elements in the array drops to one-quarter of its allocated size, the array size should be halved.

    Your code should work with this test program. It is designed to test your implementation of List class.

  2. Variable Size Array with Classes, Implementation. Create a project titled Lab11_ListClasses. Using the class implemented in the first part of this lab, implement the functionality of the second part of the previous lab. That is, write a program that asks the user to input numbers to add to and remove from the array and then prints its contents. If the duplicate is entered, the program should state duplicate!

Milestone: implement addNumber(), removeNumber(), and check() functions for the first part of the assignment.

Make sure your programs adhere to proper programming style. Submit your projects to the subversion repository. Do not forget to verify your submission on the web.