      1  #ifndef PRODUCT_H
      2  #define PRODUCT_H
      3
      4  #include <string>
      5
      6  using namespace std;
      7
      8  /**
      9     Describes a product with a description and a price.
     10  */
     11  class Product
     12  {
     13  public:
     14     /**
     15        Constructs a product with a given description and price.
     16        @param d the description
     17        @param p the price
     18     */
     19     Product(string d, double p);
     20     /**
     21        Gets the product description.
     22        @return the description
     23     */
     24     string get_description() const;
     25     /**
     26        Gets the product price.
     27        @return the price
     28     */
     29     double get_price() const;
     30
     31  private:
     32     string description;
     33     double price;
     34  };
     35
     36  inline string Product::get_description() const
     37  {
     38     return description;
     39  }
     40
     41  inline double Product::get_price() const
     42  {
     43     return price;
     44  }
     45
     46  #endif