total (product items[], int length, TOTAL_* target)
   if (target == TOTAL_PRICE)
   -> (float64 result = 0) 
{
  for (i = 0; i < length; i ++) result += array[i].price;
}

total (product items[], int length, TOTAL_* target)
   if (target == TOTAL_WEIGHT)
   -> (float64 result = 0) 
{
  for (i = 0; i < length; i ++) result += array[i].weight;
}
