#include "educators.h" Educator::Educator(const string & name, int energy) : myName(name), myEnergy(energy) { // work done in intializer list } Educator::~Educator() { // nothing needed, no dynamic memory allocated } void Educator::Eat() { myEnergy += 5; cout << "another candy bar on-the-run" << endl; } void Educator::Work() { myEnergy -= 20; cout << "think, prepare, think, educate,..." << endl; } void Educator::Sleep() { myEnergy += 10; cout << "Zzzzzzzzzzzzz, resting sleep" << endl; } void Educator::BeAlive() { Eat(); Work(); Sleep(); } bool Educator::IsAlive() const { return myEnergy > 0; } string Educator::Name() const { return myName; } int Educator::Energy() const { return myEnergy; }