Objectives of This Chapter
By the end of this chapter, you should
understand how we can use inheritance to create a new class by extending an existing class, and
understand how to use manipulators to control the format of iostream output.
Two Reasons to Use Inheritance
Before we return to the detailed examination of our inventory control classes (StockItem and its companion class Inventory) let's expand a bit on the first objective as it applies to this case.
There are two reasons to use inheritance. The first is to create a new class that has all of the capabilities of an existing class while adding capabilities that are unique to the new class. In such a case, objects of the new class are clearly not equivalent to objects of the existing class ...