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

Method volume

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

Function to calculate the volume of a Box object

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected