▾ Part 2: Evaluate T¹+y¹+¹ i=0 n-1 20 (10 points) z¹+¹+1 n Complete the function summation, which computes and returns t
Posted: Fri Jun 10, 2022 11:55 am
▾ Part 2: Evaluate T¹+y¹+¹ i=0 n-1 20 (10 points) z¹+¹+1 n Complete the function summation, which computes and returns the value of 1 , where x and y are real numbers, and ʼn is an integer. Assume n > 1. x, y and n are passed as arguments to summation of the same names. This summation expands to Σ-0²-1 z²+³+1 zº+y⁰+1 z¹+y¹+1 + n-1 z"+y+1 = +...+ n-1 Because we don't know what n is until the function is called, we need to write a loop that will compute the value of the expression. Examples: Function Call Return Value summation (2.0, 3.0, 8) summation (-2.5, 4.1, 7) summation (4.5, -1.8, 12) 20039959. 285714284 1010173. 38671875 10021395406603.846