#include #include "BucketT.h" #include "GameConstants.h" using namespace std; void PrintBucket(BucketT bucket); int main() { size_t i; int j; BucketT bucket; cout << "An empty bucket" << endl; PrintBucket(bucket); for (j = 1; j<= 4; j++) { bucket.Dump(); for(i=0; i < MAX_CHERRIES + 5; i++) { bucket.AddCherries(j); cout << "Adding " << j << " cherrys " << 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(BucketT bucket){ // check to see if the count is between 0 and MAX_CHERRIES // complain if it is not. cout << " The bucket now has " << bucket.GetCherryCount() << " cherries." << endl; cout << endl; return; }