| 31 | } |
| 32 | |
| 33 | int main() |
| 34 | { |
| 35 | Box box1{ 2.0, 3.0, 4.0 }; // An arbitrary box |
| 36 | Box box2{ 5.0 }; // A box that is a cube |
| 37 | std::cout << "box1 volume = " << box1.volume() << std::endl; |
| 38 | std::cout << "box2 volume = " << box2.volume() << std::endl; |
| 39 | } |
| 40 | |
| 41 | double Box::volume() |
| 42 | { |