product.h

来自「C++ 这是国外计算机科学教材系列《big C++》书籍的源代码ch6」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef PRODUCT_H
#define PRODUCT_H

#include <string>

using namespace std;

class Product
{
public:
   /**
      Constructs a product with score 0 and price 1.
   */
   Product();

   /**
      Reads in this product object.
   */   
   void read();

   /**
      Compares two product objects.
      @param b the object to compare with this object
      @retur true if this object is better than b
   */
   bool is_better_than(Product b) const;

   /**
      Print this product object
   */
   void print() const;
private:
   string name;
   double price;
   int score;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?