Write a recursive function that computes and returns the product of the integers in the array anArray[first..last].

What will be an ideal response?

```
// Precondition: anArray[first..last] is an array of integers,
// where first <= last.
// Postcondition: Returns the product of the integers in
// anArray[first..last].
double computeProduct(const int anArray[], int first, int last)
{
if (first == last)
return anArray[first];
else
return anArray[last] * computeProduct(anArray, first, last - 1);
} // end computeProduct

```

Computer Science & Information Technology

You might also like to view...

Which feature in Windows XP enables you to change to another user account without logging out of the current user account?

A. Users and Groups b. User Account Control c. Fast User Switching d. Change Accounts

Computer Science & Information Technology

What method does the CPU use to divide its computing cycles between more than one process?

A. context switching B. process switching C. time slicing D. thread slicing

Computer Science & Information Technology