Task

Write a program to find the sum of squares of a numeric vector.

The program should work on a zero-length vector (with an answer of   0).



Related task

   Mean


list$ = "1,2,3,4,5"
print sumOfSquares(list$)
 
FUNCTION sumOfSquares(sos$)
  while word$(sos$,i+1,",") <> ""
    i = i + 1
    sumOfSquares = sumOfSquares + val(word$(sos$,i,","))^2
  wend
END FUNCTION