#include "employee.h"
class staff : public employee
{
public:
int calculateSalary();
staff();
staff(int);
virtual ~staff();
};
// staff.cpp: implementation of the staff class.
#include "staff.h"
staff::staff()
{
employee();
}
staff::staff(int inBase)
{
setBase(inBase);
}
staff::~staff()
{
}
int staff::calculateSalary()
{
return base+10000;
}
// company.cpp : Defines the entry point for the console application.
#include "employee.h"
#include "manager.h"
#include "staff.h"
#include <iostream.h>
int main(int argc, char* argv[])
{
employee *e[2];
e[0] = new manager(24000);
e[1] = new staff(24000);
for(int i=0; i<2; i++) {
cout << e[i]->calculateSalary() <<endl;;
}
return 0;
}
No comments:
Post a Comment