MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / Box

Class Box

Examples/NoModules/Chapter 14/Ex14_01A/Box.h:5–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#define BOX_H
4
5class Box
6{
7public:
8 Box() = default;
9 Box(double length, double width, double height)
10 : m_length{ length }, m_width{ width }, m_height{ height }
11 {}
12
13 double volume() const { return m_length * m_width * m_height; }
14
15 // Accessors
16 double getLength() const { return m_length; }
17 double getWidth() const { return m_width; }
18 double getHeight() const { return m_height; }
19
20private:
21 double m_length {1.0};
22 double m_width {1.0};
23 double m_height {1.0};
24};
25#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected