Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

you are examining a program and see that it includes a method declared …

Question

you are examining a program and see that it includes a method declared with the following header. num sumvalues (num x)
in the main part of the program, you see the following statement. mysum = sumvalues (dailytotals)
you correctly recognize that _____.
a. sumvalues () returns an array
b. sumvalues () takes a single element of an array as a parameter
c. dailytotals is an array
d. dailytotals is a numeric variable

Explanation:

Brief Explanations

The method sumValues has a parameter declared as num[] x, which indicates it takes an array as a parameter. In the call mySum = sumValues(dailyTotals), dailyTotals is passed as the argument to sumValues, so it must be an array to match the parameter type.

Answer:

C. dailyTotals is an array