// the Bus class class Bus { private: int capacity; // passenger capacity int currNum; // passengers in the bus public: // constructor Bus(); // adjust passenger number void addPass(int newPass); // adds newPass new passengers void subPass(int leaving); // leaving passengers leave // test if no passengers bool empty(); }; // *********************************************************** // Bus class implementation // *********************************************************** // constructor Bus::Bus() { currNum = 0; capacity = 100; } // adjust passenger numbers void Bus::addPass(int newPass) { currNum = currNum + newPass; } void Bus::subPass(int leaving) { currNum = currNum - leaving; } // test for empty bus bool Bus::empty() { bool isEmpty = false; if (currNum <= 0) { isEmpty = true; } return isEmpty; }