#ifndef _STUDENT_H #define _STUDENT_H #include "CPstring.h" // base-class for a generic student // Owen Astrachan written November, 1996 // // Student("name") -- constructs a student 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 of student // // int Energy() -- returns energy level // // NOTE: there are some bad design decisions in this class class Student { public: Student(const string & name,int energy = 100); virtual ~Student(); 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