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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:00, kmsg2000
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse. txt.
Answers: 3
image
Computers and Technology, 22.06.2019 15:30, mariap3504
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
image
Computers and Technology, 24.06.2019 17:00, 322993
Following are uses of spreadsheets. for each use, choose whether the use is a business use, consumer use, or student use. family budget: sales data: recording research data for science class:
Answers: 2
image
Computers and Technology, 24.06.2019 17:30, mikemofun9079
When you type january in a cell, then copy it using the fill handle to the cells below and the data automatically changes to february, march, april, and so on, what is this feature called? auto fill automaticcopy monthfill textfill
Answers: 1
You know the right answer?
//public class ArraySumDriver import java. util. Arrays;

public class ArraySumDriver {<...

Questions in other subjects:

Konu
Mathematics, 26.03.2021 01:00
Konu
Mathematics, 26.03.2021 01:00
Konu
Social Studies, 26.03.2021 01:00