Write a method called sumArray that accepts an array of floating point values and returns the sum of the values stored in the array.

What will be an ideal response?


```
public float sumArray(float[] values)
{
float sum = 0;
for (int index = 0; index < values.length; index++)
sum += values[index];
return sum;
}

```

Computer Science & Information Technology

You might also like to view...

Consider the database shown in Table 7.14. What are the support and confidence values for the following negative association rules involving regular and diet soda?

The original association rule mining framework considers only presence of items together in the same transaction. There are situations in which itemsets that are infrequent may also be informative. For instance, the itemset TV, DVD, ¬ VCR suggests that many customers who buy TVs and DVDs do not buy VCRs. In this problem, you are asked to extend the association rule framework to negative itemsets (i.e., itemsets that contain both presence and absence of items). We will use the negation symbol (¬) to refer to absence of items. i. ¬Regular ?? Diet. ii. Regular ?? ¬Diet. ii. Regular ?? ¬Diet. iv. Diet ?? ¬Regular.

Computer Science & Information Technology

What is the underscore character used for in VBScript?

a) It is used to denote header files b) It is used to separate multiple word variable names c) It is used by the compiler to identify VBScript macros d) It is used as a line continuation character

Computer Science & Information Technology

Viewers of a(n) ____________________ presentation need access to the Internet, a web browser, and the URL for the presentation.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following are valid specifiers for the printf statement?

a. %4c b. %10b c. %6d d. %8.2d e. %10.2e

Computer Science & Information Technology