employeetype.h

来自「C++编成数据结构与程序设计方法 D.S.Malk编著」· C头文件 代码 · 共 38 行

H
38
字号
#ifndef H_employeeType
#define H_employeeType

#include "personType.h"

class employeeType: public personType
{
public:
    virtual void print() const = 0;
      //Function to output employee's data.

    virtual double calculatePay() const = 0; 
      //Function to calculate and return the wages.
      //Postcondition: Pay is calculated and returned

    void setId(long id);
      //Function to set the salary.
      //Postcondition: personId = id

    long getId() const;
      //Function to retrieve the id.
      //Postcondition: returns personId

    employeeType(string first = "", string last = "", 
                 long id = 0);
      //Constructor with parameters
      //Sets the first name, last name, payRate, and 
      //hoursWorked according to the parameters. If
      //no value is specified, the default values are 
      //assumed.
      //Postcondition: firstName = first; 
      //               lastName = last; personId = id

private:
    long personId;     //stores the id
}; 

#endif

⌨️ 快捷键说明

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