/* File: main.C Use the Box class. */ #include #include "box.h" main() { Box b1 = Box(1.0, 2.0, 3.1) ; Box b2 = Box(0.5, 2.5, 3.0) ; Box b3 = Box(1.1, 3.0, 3.5) ; int r ; printf("b1: ") ; b1.identify() ; printf("b2: ") ; b2.identify() ; printf("b3: ") ; b3.identify() ; b3.debug() ; printf("\n\n") ; r = compare(b1,b2) ; if (r < 0) { printf("Box b1 fits inside box b2\n") ; } else if (r > 0) { printf("Box b2 fits inside box b1\n") ; } else { printf("Boxes b1 and b2 are incomparable\n") ; } r = compare(b1,b3) ; if (r < 0) { printf("Box b1 fits inside box b3\n") ; } else if (r > 0) { printf("Box b3 fits inside box b1\n") ; } else { printf("Boxes b1 and b3 are incomparable\n") ; } r = compare(b2,b3) ; if (r < 0) { printf("Box b2 fits inside box b3\n") ; } else if (r > 0) { printf("Box b3 fits inside box b2\n") ; } else { printf("Boxes b2 and b3 are incomparable\n") ; } }