subject

Public static void arraymystery(int[] a) {
for (int i = 1; i < a. length - 1; i++) {
a[i] = a[i - 1] - a[i] + a[i + 1];
}
}
indicate in the right-hand column what values would be stored in the array after the method arraymysteryexecutes if each integer array below is passed as a parameter to it.

int[] a1 = {42, 42};
arraymystery(a1);

int[] a2 = {6, 2, 4};
arraymystery(a2);
int[] a3 = {7, 7, 3, 8, 2};
arraymystery(a3);

int[] a4 = {4, 2, 3, 1, 2, 5};
arraymystery(a4);

int[] a5 = {6, 0, -1, 3, 5, 0, -3};
arraymystery(a5);

i know the answers are:

{42, 42}

{6, 8, 4}

{7, 3, 8, 2, 2}

{4, 5, 3, 4, 7, 5}

{6, 5, 9, 11, 6, 3, -3}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
Corey set up his presentation for delivery to his team.the information he had to convey was critical to their job performance.he knew he would need a lot of time to explain each point
Answers: 3
question
Computers and Technology, 22.06.2019 17:30
Where would you click to edit the chart data?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
question
Computers and Technology, 26.06.2019 11:00
What option is found in the alignment tab of the format cells dialog box
Answers: 1
You know the right answer?
Public static void arraymystery(int[] a) {
for (int i = 1; i < a. length - 1; i++) {
Questions
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Physics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
History, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
question
Mathematics, 03.02.2021 01:00
Questions on the website: 13722361