August 2002
Beginner
1122 pages
22h 1m
English
| 3. | Rewrite the DrugStockItem class that you wrote earlier in this chapter as a derived class of DatedStockItem, adding the new class to the polymorphic object implementation based on the StockItem class. The Reorder member function of the DrugStockItem class will be inherited from DatedStockItem, and the member function DeductSaleFromInventory will have to be made a virtual function in StockItem so that the correct version will be called via the StockItem* in the StockItem class. The resulting set of classes will allow the effective type of a StockItem object to be any of UndatedStockItem, DatedStockItem, or DrugStockItem. |
| 4. | Rewrite the Employee, Exempt, and Hourly classes that you wrote earlier in this chapter as a set of ... |
Read now
Unlock full access