Function to calculate the volume of a Box object
| 14 | |
| 15 | // Function to calculate the volume of a Box object |
| 16 | virtual double volume() const { return m_length * m_width * m_height; } |
| 17 | |
| 18 | protected: // Should be private in production-quality code (add getters to access) |
| 19 | double m_length, m_width, m_height; |