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

Function main

Exercises/NoModules/Chapter 13/Soln13_09/Soln13_09.cpp:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18int main()
19{
20 const double limit{ 99.0 }; // Upper limit on Box dimensions
21 auto random{ createUniformPseudoRandomNumberGenerator(limit) };
22
23 Truckload load;
24 const size_t boxCount {20}; // Number of Box object to be created
25
26 // Create boxCount Box objects
27 for (size_t i {}; i < boxCount; ++i)
28 load.addBox(std::make_shared<Box>(random(), random(), random()));
29
30 std::cout << "The boxes in the Truckload are:\n";
31 std::cout << load << std::endl;
32
33 Truckload copied;
34 copied = load; // Use copy assignment
35
36 std::cout << "The boxes in the copied Truckload are:\n";
37 std::cout << copied;
38}

Callers

nothing calls this directly

Calls 2

addBoxMethod · 0.45

Tested by

no test coverage detected