property.h

来自「c++编程宝典源码及Quincy99编译器 是《标准C++编程宝典》电子工业出」· C头文件 代码 · 共 41 行

H
41
字号
////////////////////////////////////////
// File Name: Property.h
////////////////////////////////////////
#ifndef PROPERTY_H
#define PROPERTY_H

#include <string>
#include <Date.h>
#include <Money.h>
#include "DisplayObject.h"

class Property : public virtual DisplayObject
{
    int idnbr;         // id number
    std::string name;  // property name
    Date dateacquired; // date acquired
    Money cost;        // cost

protected:
    Property(int id) : idnbr(id)
        { }
    virtual ~Property() { }
public:
    int GetNbr() const
        { return idnbr; }
    void SetName(const std::string& nm)
        { name = nm; }
    const std::string& GetName()
        { return name; }
    void SetDate(Date dt)
        { dateacquired = dt; }
    const Date& GetDate() const
        { return dateacquired; }
    void SetCost(Money cst)
        { cost = cst; }
    Money GetCost() const
        { return cost; }
};

#endif

⌨️ 快捷键说明

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