Charlie's Collection: Objects with Dynamically Allocated Members
- Collection with Classes, Testing.
Study Code and Object Definition Windows of Microsoft
Visual Studio described here. As you
work on the below project, demonstrate to the instructor the usage of
this feature.
Create a project
titled Lab11_CollectionTest. Implement the collection of
doubles described in the previous lab as a
class Collection. You should
use this class definition. The class
attributes are a pointer to the dynamically allocated
array col_ and the array size size_ This
class contains two groups of methods:
- Member functions output(), value(), check() addNumber() and
removeNumber() have exactly the same functionality as
described in the previous lab.
- copy constructor, overloaded assignment and destructor ensure
correct handling of the objects with dynamically allocated members.
Your code should work with this test program. It is
designed to test your implementation of Collection class.
- Variable Size Array with Classes, Implementation. Create a
project titled Lab11_CharliesCollectionClasses. 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 and the total value stored in all the elements.
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.