Function to compute total yield
| 16 | |
| 17 | // Function to compute total yield |
| 18 | double yield(const double array[][4], size_t size) |
| 19 | { |
| 20 | double sum {}; |
| 21 | for (size_t i {}; i < size; ++i) // Loop through rows |
| 22 | { |
| 23 | for (size_t j {}; j < std::size(array[i]); ++j) // Loop through elements in a row |
| 24 | { |
| 25 | sum += array[i][j]; |
| 26 | } |
| 27 | } |
| 28 | return sum; |
| 29 | } |