#ifndef _EDUCATOR_H #define _EDUCATOR_H #include "CPstring.h" // base-class for a generic educator // Owen Astrachan for PLDI, FRCR 1996 // // Educator("name") -- constructs an eductor with given name // // void BeAlive() -- // consists of Eat(), Work(), Sleep() // these functions, all virtual, print a message // and cause energy to be lost (Work) or gained (Eat/Sleep) // // bool IsAlive() -- returns true if alive, else false // (alive if energy > 0) // // string Name() -- returns name // // int Energy() -- returns energy level // // NOTE: there are some bad design decisions in this class class Educator { public: Educator(const string & name,int energy = 100); virtual ~Educator(); virtual void Eat(); virtual void Work(); virtual void Sleep(); virtual void BeAlive(); bool IsAlive() const; string Name() const; int Energy() const; protected: string myName; int myEnergy; }; #endif