/* File: main.C Use the second Box class. */ #include #include "box2.h" main() { Box b1, b3 ; /* uses default constructor */ Box b2 = Box(1.0, 2.0, 3.1) ; /* uses second constructor */ Box boxes[4] ; /* uses default constructor */ float volume ; int i ; /* call "member function" b1 with b1. */ printf("b1: ") ; b1.identify() ; printf("b2: ") ; b2.identify() ; printf("b3: ") ; b3.identify() ; printf("\n") ; volume = b1.volume() ; printf("b1 volume = %f\n", volume) ; b1.grow() ; b1.identify() ; volume = b1.volume() ; printf("b1 volume = %f\n", volume) ; printf("\n") ; volume = b2.volume() ; printf("b2 volume = %f\n", volume) ; b2.shrink() ; b2.identify() ; volume = b2.volume() ; printf("b2 volume = %f\n", volume) ; printf("\nWhat's in the array of boxes?\n") ; for (i = 0 ; i < 4 ; i++) { boxes[i].identify() ; } }