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

Function surfaceArea

Examples/Modules/Chapter 12/Ex12_12/Ex12_12.cpp:23–27  ·  view source on GitHub ↗

friend function to calculate the surface area of a Box object

Source from the content-addressed store, hash-verified

21
22// friend function to calculate the surface area of a Box object
23double surfaceArea(const Box& box)
24{
25 return 2.0 * (box.m_length * box.m_width
26 + box.m_length * box.m_height + box.m_height * box.m_width);
27}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected