| 4 | #include "DimensionError.h" // For the dimension_error class |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | try |
| 9 | { |
| 10 | Box box1 {1.0, 2.0, 3.0}; |
| 11 | std::cout << "box1 volume is " << box1.volume() << std::endl; |
| 12 | Box box2 {1.0, -2.0, 3.0}; |
| 13 | std::cout << "box2 volume is " << box2.volume() << std::endl; |
| 14 | } |
| 15 | catch (const std::exception& ex) |
| 16 | { |
| 17 | std::cout << "Exception caught in main(): " << ex.what() << std::endl; |
| 18 | } |
| 19 | } |