Call a method that computes the sum of the elements of the array. The header for this method is
public static int sumData(int num, int[] iArr, boolean DEBUG)
After the returning from the sumData method you will need to print out the int returned by the sumData method.
Then you will call a method that will print only the even numbers stored in the array. The header for this method is
public static void printEven(int num, int[] iArr, boolean DEBUG)
Then you will call a method that will print out the odd numbers stored in the array. The header for this method is
public static void printOdd(int num, int[] iArr, boolean DEBUG)
Detailed explanation: YES
Specific requirements:
The data in the arrays are generated at random and the array should be no bigger than 30. Pseudorandom integers should be between 10 and 90.
The program's output must be similar to this:
DEBUG
The location of array being added to the sum is 0.
The number added to sum is 95.
The current sum is 95.
DEBUG
The location of array being added to the sum is 1.
The number added to sum is 28.
The current sum is 123.
DEBUG
The location of array being added to the sum is 2.
The number added to sum is 47.
The current sum is 170.
DEBUG
The location of array being added to the sum is 3.
The number added to sum is 89.
The current sum is 259.
DEBUG
The location of array being added to the sum is 4.
The number added to sum is 98.
The current sum is 357.
The sum of the array is 357.
Even numbers in the array are:
DEBUG
The nummber in array location 0 is 95.
DEBUG
The nummber in array location 1 is 28.
DEBUG
The number is even.
intArr[1] = 28
DEBUG
The nummber in array location 2 is 47.
DEBUG
The nummber in array location 3 is 89.
DEBUG
The nummber in array location 4 is 98.
DEBUG
The number is even.
intArr[4] = 98
Odd numbers in the array are:
DEBUG
The nummber in array location 0 is 95.
DEBUG
The number is odd.
intArr[0] = 95
DEBUG
The nummber in array location 1 is 28.
DEBUG
The nummber in array location 2 is 47.
DEBUG
The number is odd.
intArr[2] = 47
DEBUG
The nummber in array location 3 is 89.
DEBUG
The number is odd.
intArr[3] = 89
DEBUG
The nummber in array location 4 is 98.