2. Using C++ code, write a program to compute the sum of the first n terms of the series XXXXXXXXXX XXXXXXXXXX + 47 + …, where n is a random integer in the range [1,24].3. Using C++ code, write a...

2. Using C++ code, write a program to compute the sum of the first n terms of the series 2 + 3 + 5 + 8 + 12 + 17 + 23 + 30 + 38 + 47 + …, where n is a random integer in the range [1,24].




















3. Using C++ code, write a program to compute the product of the sums S1 and S2 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 S1. Thirdly, a function odd_sum receives, as parameters, A and n, and computes and returns S2. Lastly, a function finalize receives, as parameters, S1 and S2 and computes and prints the product of S1 and S2.
Dec 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here