Question: Hello. I need help writing this java program. The only thing is don't SORT the array. Here are the directions and an example. Ask the
Hello. I need help writing this java program. The only thing is don't SORT the array.
Here are the directions and an example.
Ask the user how many elements they would like in their array of integers.
You may assume they will always enter a value greater than 0. Populate the array with random values from 0 to 100. Print the original array using an enhanced for loop (for each loop). Search the array, find the smallest element and switch it with the first element in the array. Search the array, find the largest element and switch it with the last element in the array. DO NOT SORT THE ENTIRE ARRAY, just the first and last element. Print the updated array 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
