#include #include "BucketT.h" #include "GameConstants.h" using namespace std; void PrintBucket(const BucketT & bucket); int main() { size_t i; BucketT bucket; cout << "An empty bucket" << endl; PrintBucket(bucket); for(i=0; i < MAX_CHERRIES + 5; i++) { bucket.AddCherries(1); cout << "Adding a cherry " << endl; PrintBucket(bucket); } cout << "Spilling the bucket" << endl; bucket.Dump(); PrintBucket(bucket); cout << "Filling the bucket " << endl; bucket.AddCherries(MAX_CHERRIES); PrintBucket(bucket); cout << "Attempting to add more cherries " << endl; bucket.AddCherries(1); PrintBucket(bucket); cout << "Removing cherries" << endl; for(i=0; i < MAX_CHERRIES + 5; i++) { bucket.SubtractCherries(1); cout << "Removing a cherry " << endl; PrintBucket(bucket); } return 0; } void PrintBucket(const BucketT & bucket){ cout << " The bucket now has " << bucket.GetCherryCount() << " cherries." << endl; cout << endl; return; }