Write a recursive function double recSum(double array[], int count); that takes an int argument and returns the sum of count array entries.
What will be an ideal response?
```
//Pre: Arguments are defined and initialized
//Post: return value is the sum of count array entries
double recSum(double array[], int count)
{
if (count == 0) return 0;
else
{
return recSum(array, count-1) + array[count-1];
}
}
```
You might also like to view...
When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirements have been approved. Suggest a model of a process for making these modifications that will ensure that the requirements document and the system implementation do not become inconsistent.
What will be an ideal response?
When you ______ for a spreadsheet, you create a symbolic reference for a range of cells.
Fill in the blank(s) with the appropriate word(s).
In a program that uses an endfile-controlled loop to compute product of a list of numeric input data, the product variable must be initialized to __________.
a. 0 b. 1 c. -1 d. the EOF value e. none of the above
A technician encounters prohibited materials on a computer located in a common area that is used by several employees. Which of the following should be done FIRST?
A. Remove the item from the computer B. Show to others so they can be a witness C. Copy the item to an external website D. Report the incident to management