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

Class Box

Examples/NoModules/Chapter 12/Ex12_12/Box.h:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#define BOX_H
3
4class Box
5{
6public:
7 Box() : Box{ 1.0, 1.0, 1.0} {} // A delegating default constructor
8 Box(double length, double width, double height);
9
10 double volume() const; // Function to calculate the volume of a box
11
12 friend double surfaceArea(const Box& box); // Friend function for the surface area
13
14private:
15 double m_length, m_width, m_height;
16};
17
18#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected