📄 product.h
字号:
#include <string>
using namespace std;
/**
Describes a product with a description and a price
*/
class Product
{
public:
/**
Constructs a product with empty description and zero price.
*/
Product();
/*
Constructs a product from a description and a price.
@param d the product description
@param p the product price
*/
Product(string d, double p);
/*
Gets the product description.
@return the description
*/
string get_description() const;
/*
Gets the product price.
@return the unit price
*/
double get_price() const;
private:
string description;
double price;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -