Show how the function that you wrote for the previous question satisfies the properties of a recursive function.

What will be an ideal response?

1. computeProduct calls itself.
2. An array of n numbers is passed to the method. The recursive call is given a smaller array of n - 1 numbers.
3. anArray[0] is the base case.
4. Since n ? 1 and the number of entries considered in anArray decreases by 1 at each recursive call, eventually the recursive call is computeProduct(anArray, 1). That is, n is 1, and the base case is reached.

Computer Science & Information Technology

You might also like to view...

In order to use Windows Defender, you must enable it

Indicate whether the statement is true or false

Computer Science & Information Technology

What domain deals with analytics?

a. Embedded Systems Development b. Data Science c. Cloud Development d. API Development e. Back-end Development

Computer Science & Information Technology