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

Class Box

Examples/NoModules/Chapter 15/Ex15_11/Box.h:6–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "Vessel.h"
5
6class Box : public Vessel
7{
8public:
9 Box(double l, double w, double h) : m_length {l}, m_width {w}, m_height {h} {}
10
11 double volume() const override { return m_length * m_width * m_height; }
12
13protected: // Should be private in production-quality code (add getters to access)
14 double m_length, m_width, m_height;
15};
16
17#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected