+ 2
Java Arrays and Methods Help!
Main() holds an array 10 integers. Create 2 methods that accept the array. 1st method named average returns the average from the 10 numbers while the second method named returns the greatest number from the list. !! Please help me, im stock at 1st method i can't call the variable in to the method
2 Antworten
+ 8
Pass your array named arr like this:
int avrg = average(arr);
Your method must be declared as following then:
public static int average(int[] arr){
int avrg;
// add code to calculate average value
return avrg;
}
0
Thanks tashi 👍, I will code it later.