#include #include #include "SizeT.h" using namespace std; string FindAction(int diff); string HugeComment(SizeT size); int main() { SizeT one, two; int i; int sizeDifference; for(i = 0; i < 10; i++) { one = RandomSize(); two = RandomSize(); sizeDifference = SizeDifference(one,two); cout << "A " << SizeTToString(one) << " critter meets a " << SizeTToString(two) << " critter." << endl; cout << "\tThe difference in sizes is " << sizeDifference << "." << endl; cout << "\tSo the critters " << FindAction(sizeDifference) << "." << endl; if (one == SizeT::HUGE) { cout << "Creature one says " << HugeComment(two) << endl; } cout << endl; } return 0; } string FindAction(int diff) { string action; switch(diff) { case 0: action = "make friends"; break; case 1: action = "look at each other in amazement"; break; default: action = "fail to notice each other"; break; } return action; } string HugeComment(SizeT size){ string response; switch(size) { case SizeT::TINY: case SizeT::SMALL: case SizeT::GARGANTUAN: response = "What, I don't see you!"; break; case SizeT::MEDIUM: response = "Look at that tiny little thing!"; break; case SizeT::LARGE: response = "Will you be my friend?"; break; case SizeT::HUGE: response = "Look at that big thing!"; break; default: response = "I don't know what size that thing is!"; } return response; }