Menu

Hello Need Help Writing Java Program Thing Don T Sort Array Directions Example Ask User Ma Q43895008

Hello. I need help writing this java program. The only thing isdon’t SORT the array.

Here are the directions and an example.

Ask the user how many elements they would like in their array ofintegers.  

You may assume they will always enter a value greater than 0.Populate the array with random values from 0 to 100. Print theoriginal array using an enhanced for loop (for each loop). Searchthe array, find the smallest element and switch it with the firstelement in the array. Search the array, find the largest elementand switch it with the last element in the array. DO NOT SORT THEENTIRE ARRAY, just the first and last element. Print the updatedarray using an enhanced for loop.

Here is an example:

How many numbers would you like in your array? 10

Original Array:

21 43 30 8 30 82 75 79 19 54

Updated Array

8 43 30 21 30 54 75 79 19 82

Expert Answer


Answer to Hello. I need help writing this java program. The only thing is don’t SORT the array. Here are the directions and an exa…

OR