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

Method showVolume

Examples/NoModules/Chapter 15/Ex15_07/Box.h:18–19  ·  view source on GitHub ↗

Function to show the volume of an object

Source from the content-addressed store, hash-verified

16
17 // Function to show the volume of an object
18 void showVolume() const
19 { std::cout << "Box usable volume is " << volume() << std::endl; }
20
21 // Function to calculate the volume of a Box object
22 virtual double volume() const { return m_length * m_width * m_height; }

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected