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

Function main

Exercises/Modules/Chapter 09/Soln9_03.cpp:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16std::span<double> normalize_range(std::span<double> data);
17
18int main()
19{
20 double samples[] {
21 11.0, 23.0, 13.0, 4.0,
22 57.0, 36.0, 317.0, 88.0,
23 9.0, 100.0, 121.0, 12.0
24 };
25
26 show_data(samples, "Original Values"); // Output original values
27 normalize_range(samples); // Normalize the values
28 show_data(samples, "Normalized Values", 12); // Output normalized values
29}
30
31// Outputs an array of double values
32void show_data(std::span<const double> data,

Callers

nothing calls this directly

Calls 2

show_dataFunction · 0.70
normalize_rangeFunction · 0.70

Tested by

no test coverage detected