parttimeemployeeimp.cpp

来自「data+structures+using+c的源码」· C++ 代码 · 共 36 行

CPP
36
字号
//Implementation File partTimeEmployee

#include <iostream>
#include <string>
#include "person.h"
#include "pTEmployee.h"

using namespace std;

void partTimeEmployee::print()
{
	personType::print();//prints the name of the //employee
	cout<<" wages are : "<<calculatePay()<<endl;
}

double partTimeEmployee::calculatePay()
{
	return (payRate * hoursWorked);
}

void partTimeEmployee::setNameRateHours(string first, 
                string last, double rate, double hours)
{
	personType::setName(first,last);
	payRate = rate;
	hoursWorked = hours;
}

partTimeEmployee::partTimeEmployee(string first, string last, 
                     double rate, double hours)
          : personType(first, last) //constructor 
{
	payRate = rate;
	hoursWorked = hours;
} 

⌨️ 快捷键说明

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