      1  #include "bundle.h"
      2
      3  void Bundle::add(Item* it)
      4  {
      5     items.push_back(it);
      6  }
      7
      8  double Bundle::get_unit_price() const
      9  {
     10     double price = 0;
     11     for (int i = 0; i < items.size(); i++)
     12     {
     13        price = price
     14           + items[i]->get_unit_price() * items[i]->get_quantity();
     15     }
     16     return price;
     17  }
     18
     19  string Bundle::get_description() const
     20  {
     21     string description = "";
     22     for (int i = 0; i < items.size(); i++)
     23     {
     24        if (i > 0) description = description + ", ";
     25        description = description + items[i]->get_description();
     26     }
     27     return description;
     28  }
     29
     30  int Bundle::get_quantity() const
     31  {
     32     return 1;
     33  }
     34
     35