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

Function main

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

Source from the content-addressed store, hash-verified

3import box;
4
5int main()
6{
7 Box myBox {3.0, 4.0, 5.0};
8 std::cout << "myBox dimensions are " << myBox.getLength()
9 << " by " << myBox.getWidth()
10 << " by " << myBox.getHeight() << std::endl;
11
12 myBox.setLength(-20.0).setWidth(40.0).setHeight(10.0); // Set all dimensions of myBox
13
14 std::cout << "myBox dimensions are now " << myBox.getLength() // 3 (unchanged)
15 << " by " << myBox.getWidth() // by 40
16 << " by " << myBox.getHeight() << std::endl; // by 10
17}

Callers

nothing calls this directly

Calls 6

getLengthMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
setHeightMethod · 0.45
setWidthMethod · 0.45
setLengthMethod · 0.45

Tested by

no test coverage detected