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

Function main

Exercises/Modules/Chapter 12/Soln12_03/Soln12_03.cpp:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 ***********************************************************/
15
16int main()
17{
18 // Create the even operands as Integers,
19 // and use implicit conversions from int for the odd values
20 const Integer four{4};
21 const Integer six{6};
22 const Integer eight{8};
23
24 // We can calculate 4*5*5*5+6*5*5+7*5+8 as:
25 // ((4*5+6)*5+7)*5+8
26 Integer result {four}; // Set result object as copy of four
27 std::cout << "Result is "
28 << result.multiply(5).add(six).multiply(5).add(7).multiply(5).add(eight).getValue()
29 << std::endl;
30}

Callers

nothing calls this directly

Calls 1

getValueMethod · 0.45

Tested by

no test coverage detected