Function to show the volume of an object
| 16 | |
| 17 | // Function to show the volume of an object |
| 18 | void showVolume() const |
| 19 | { std::cout << "Box usable volume is " << volume() << std::endl; } |
| 20 | |
| 21 | // Function to calculate the volume of a Box object |
| 22 | virtual double volume() const { return m_length * m_width * m_height; } |