Search for question
Question

3. Using C++ code, write a program to compute the product of the sums S, and S₂ of the even

(indexes 0, 2, 4, 6, 8, ...) and odd (indexes 1, 3, 5, 7, 9, ...) elements, respectively, of a vector

(or array) A of n = 75 random integers in the range [0,100]. First, A is created and initialized

using 75 random integers in the function main. Secondly, a function even_sum receives,

as parameters, A and n, and computes and returns S₁. Thirdly, a function odd_sum

receives, as parameters, A and n, and computes and returns S₂. Lastly, a function

finalize receives, as parameters, S. and S₂ and computes and prints the product of S₁

and S₂.