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

Class Box

Examples/NoModules/Chapter 12/Ex12_03/Ex12_03.cpp:5–17  ·  view source on GitHub ↗

Class to represent a box

Source from the content-addressed store, hash-verified

3
4// Class to represent a box
5class Box
6{
7public:
8 Box() = default;
9 Box(double length, double width, double height);
10
11 double volume(); // Function to calculate the volume of a box
12
13private:
14 double m_length{ 1.0 };
15 double m_width{ 1.0 };
16 double m_height{ 1.0 };
17};
18
19int main()
20{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected