subject

//public class ArraySumDriver import java. util. Arrays;

public class ArraySumDriver {
private final static int ARRAY_SIZE = 6;

public static void main(String[] args) {
int index = 0;

Integer[] myArray = new Integer[ARRAY_SIZE];

myArray[index++] = 13;
myArray[index++] = 5;
myArray[index++] = 12;
myArray[index++] = 6;

int sum = sumOfArray(myArray, 3);
System. out. println(sum);

myArray[index++] = 7;
myArray[index++] = 1;

sum = sumOfArray(myArray, 5);
System. out. println(sum);

/* Fabonaicc Series */
for (int i = 0; i < 7; i++) {
int term = fabonaiccSeries(i);
System. out. print(term + " ");
}

}

public static int sumOfArray(Integer[] arr, int num) {
if (num == 0)
return 0;
return sumOfArray(arr, (num - 1)) + arr[num - 1]; // PLACE HOLDER

}

public static int fabonaiccSeries(int num) {
if (num == 0)
return 0;
else if (num == 1)
return 1;
else
return fabonaiccSeries(num - 1) + fabonaiccSeries(num - 2);
}
}

using that program above pls provide like a writeup or like an explanation to explain to someone else

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:00
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
To move an excel worksheet tab, simply right-click on it drag and drop it double-click on it delete it
Answers: 1
You know the right answer?
//public class ArraySumDriver import java. util. Arrays;

public class ArraySumDriver {<...
Questions
question
Mathematics, 24.09.2020 07:01
Questions on the website: 13722361