I have the code for making a array of 8 random digits between 50-100 but I can not figure out how to get my even and odds counter working and where how to add the array of 8 numbers up for a total. Can someone help me please?
The Problem:
Declare an array to hold eight integers. Use a for loop to add eight random integers, all in the range from 50 to 100, inclusive, to this array. Duplicates are okay. Next, pass the array to a method that sorts the array and returns another array containing only the largest and smallest elements in the original array. Print these two values in main. Then use a foreach loop to display all elements of the sorted array on one line separated by a single space. This latter loop should also count the odd and even numbers in the array and determine the sum of all elements in the array.