Task

Compute the sum and product of an array of integers.




const func integer: sumArray (in array integer: valueArray) is func
  result
    var integer: sum is 0;
  local
    var integer: value is 0;
  begin
    for value range valueArray do
      sum +:= value;
    end for;
  end func;
 
const func integer: prodArray (in array integer: valueArray) is func
  result
    var integer: prod is 1;
  local
    var integer: value is 0;
  begin
    for value range valueArray do
      prod *:= value;
    end for;
  end func;