1  #ifndef PRODUCTITEM_H
  2  #define PRODUCTITEM_H
  3  
  4  #include "product.h"
  5  #include "item.h"
  6  
  7  /**
  8     An item that results from selling a quantity of a product
  9  */
 10  class ProductItem : public Item
 11  {
 12  public:
 13     /**
 14        Constructs this item.
 15        @param p the product that is being sold
 16        @param q the quantity
 17     */
 18     ProductItem(const Product& p, int q);
 19     virtual double get_unit_price() const;
 20     virtual string get_description() const;
 21     virtual int get_quantity() const;
 22  private:
 23     Product prod;
 24     int quantity;
 25  };
 26  
 27  inline int ProductItem::get_quantity() const
 28  {
 29     return quantity;
 30  }
 31  
 32  #endif