August 2017
Beginner
566 pages
12h 34m
English
We'll create a method right above the line beginning with protected void. The purpose of this method will be to find the total of some values inside an array. To create the method, we'll do the following:
We saw private, static, and double ;before. Let's name this method as Sum. Now, because we'll accept an array, we cannot create on it. Type double as an example, followed by open and closed brackets, and then values. Our parameter is named values, and a data type essentially is an array of doubles:
private static double Sum(double[] values)
Next, we'll find the Sum of the values, but first let's add the following comment above this line:
//5. values is the array that is the ...
Read now
Unlock full access