| 21 | }; |
| 22 | |
| 23 | int main() |
| 24 | { |
| 25 | Box firstBox {80.0, 50.0, 40.0}; // Create a box |
| 26 | double firstBoxVolume {firstBox.volume()}; // Calculate the box volume |
| 27 | std::cout << "Volume of Box object is " << firstBoxVolume << std::endl; |
| 28 | |
| 29 | Box secondBox; // No longer causes a compiler error message |
| 30 | } |
| 31 | |
| 32 | // Constructor definition |
| 33 | Box::Box(double length, double width, double height) |