| 2 | #define BOX_H |
| 3 | |
| 4 | class Box |
| 5 | { |
| 6 | public: |
| 7 | // Constructors |
| 8 | Box() = default; |
| 9 | Box(double length, double width, double height); |
| 10 | |
| 11 | double volume(); // Function to calculate the volume of a box |
| 12 | |
| 13 | // Functions to provide access to the values of member variables |
| 14 | double getLength() { return m_length; } |
| 15 | double getWidth() { return m_width; } |
| 16 | double getHeight() { return m_height; } |
| 17 | |
| 18 | // Functions to set member variable values |
| 19 | void setLength(double length) { if (length > 0) m_length = length; } |
| 20 | void setWidth(double width) { if (width > 0) m_width = width; } |
| 21 | void setHeight(double height) { if (height > 0) m_height = height; } |
| 22 | |
| 23 | private: |
| 24 | double m_length{1.0}; |
| 25 | double m_width {1.0}; |
| 26 | double m_height{1.0}; |
| 27 | }; |
| 28 | |
| 29 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected