The primary change is that Inventory will now store the various Items in a null-terminated linked list, rather than an array that shrinks and grows. You will still have a totalPrice method, a description method, an add method, a remove method, an extra-credit overloaded operator for output, etc.
The description() method may be iterative or
recursive (or more likely, a one-line function calling a
recursive helper function), your choice.
The add method should be extremely easy if you always
add new items at the beginning of the list.
The
remove method is problematic: as described in
homework 4, it "takes in the index of an element in the
array of Item pointers," yet now there
is no array of Item pointers. We'll
interpret this to mean that if its argument is 0, it removes
the first element of the list; if its argument is 1, it
removes the second element; and so on. It may be written
recursively or iteratively, your choice.
The totalPrice method will need to be rewritten; it
too may be recursive or iterative, your choice.
Inventory should also have a length method that returns the number of items in the inventory. This method may be written recursively or iteratively, your choice.
You'll probably need to write another class ItemListEntry that contains an Item and a pointer to another ItemListEntry. When this pointer is null, it indicates that you're at the end of the list. The Inventory class will have an instance variable of type ItemListEntry * pointing to the first entry (if any).
Alternatively, you may implement a doubly-linked list instead, in which case the Inventory class will probably have two instance variables of type ItemListentry * pointing to the first and last entries (if any), or to dummy head and tail entries, or something like that.