Question: Can someone help me with this program, please? Declare an array to hold 8 integers. Use a for loop to add 8 random integers, all

Can someone help me with this program, please? Declare an array to hold 8 integers. Use a for loop to add 8 random integers, all in the range from 50 to 100, inclusive, to this array. (Dups are ok.) 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 2 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. Sample Output: The lowest element is 59 (next line) The highest element is 96 (next line) Here is the array (next line) 59 64 76 77 80 88 91 96 (next line) Evens: 5, odds: 3 (next line) Total: 631

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!