I am trying to figure out how to write a loop that will calculate the sum of elements in an array up to the current index. This is for part of a solution for calculating prefix averages. I have included my method so far (including the pseudo-code I am trying to write). I would appreciate any help offered!I am trying to figure out how to write a loop t