I can not understand how to do a task with an array in "Java", where to start? I signed up for courses on "Java", they gave me a task, for a bloody day I don’t understand how to do it (((please tell me. Thank you in advance for the explanation).
The task itself:
Input: array with size = 10 can be of one of two data types: int and double. Calculate: sum min/max max positive multiplication modulus of first and last element second largest element As a result you should have methods with following names : sum(int array[]), sum(double[]) min(int array[]), min(double[]) max(int array[]), max(double[]) maxPositive(int array[]), maxPositive(double array[]), multiplication (int array[]), multiplication (double[]) modulus(int array[]), modulus(double[]) secondLargest(int array[]), secondLargest(double[])
public static void main(String[] args) { int myArray[] = {56,53,73,123,23,56,12,465,100,303}; int sum=0; for(int i=0; i<myArray.length; i++) { sum=sum+myArray[i]; } System.out.println(sum);public static void main(String[] args) { int myArray[] = {56,53,73,123,23,56,12,465,100,303}; int sum=0; for(int i=0; i<myArray.length; i++) { sum=sum+myArray[i]; } System.out.println(sum);- Hotosho