/* * intern.cpp * * Created on: 16.05.2013 * Author: trifon */ #include "intern.h" Intern::Intern() : period(3) { cerr << "Intern()" << endl; } Intern::Intern(int _fn, double _grade, char const* _position, double _salary, int _period) : Employee(_position, _salary), Student(_fn, _grade), period(_period) { cerr << "Intern(...)" << endl; } int Intern::getPeriod() const { return period; } void Intern::setPeriod(int _period) { period = _period; } void Intern::print() const { Student::print(); Employee::print(); cout << "Период на стажа: " << period << endl; } Intern::Intern(Intern const& i) : period(i.period), Student(i), Employee(i) { cerr << "copy Intern" << endl; } Intern::~Intern() { cerr << "~Intern()" << endl; } Intern& Intern::operator=(Intern const& i) { if (this != &i) { cerr << "= Intern" << endl; (Student&)*this = i; (Employee&)*this = i; //Student::operator=(i); //Employee::operator=(i); period = i.period; } return *this; }