📄 productitem.h
字号:
#ifndef PRODUCTITEM_H
#define PRODUCTITEM_H
#include "product.h"
#include "item.h"
/**
An item that results from selling a quantity of a product.
*/
class ProductItem : public Item
{
public:
/**
Constructs this item.
@param p the product that is being sold
@param q the quantity
*/
ProductItem(const Product& p, int q);
virtual double get_unit_price() const;
virtual string get_description() const;
virtual int get_quantity() const;
private:
Product prod;
int quantity;
};
inline int ProductItem::get_quantity() const
{
return quantity;
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -