Function to calculate the volume of a Box object
| 14 | |
| 15 | // Function to calculate the volume of a Box object |
| 16 | virtual double volume(int i = 5) const |
| 17 | { |
| 18 | std::cout << "(Box argument = " << i << ") "; |
| 19 | return m_length * m_width * m_height; |
| 20 | } |
| 21 | |
| 22 | protected: // Should be private in production-quality code (add getters to access) |
| 23 | double m_length, m_width, m_height; |