Question: 3. Sorting Array Create a program that sort array of numbers in ascending or descending order. The program should prompt the user to enter

3. Sorting Array Create a program that sort array of numbers in

   


3. Sorting Array Create a program that sort array of numbers in ascending or descending order. The program should prompt the user to enter length of the array, then prompt the user to enter a list of numbers. The value that the user has entered in the length of the array will be the basis for the number of times the user will enter. For example, the user has entered 3 for the length of the array, the user again will be asked to enter 3 numbers. After the user enters a list of numbers, ask the user if it's going to sort the array in ascending or descending order. Then display the sorted number based from the user's choice. For example: Sorting 4 elements array in ascending order: run: Enter Array Length: 4 Enter Element Number 1: 3 Enter Element Number 2: 1 Enter Element Number 3: 10 Enter Element Number 4: 0 Sort Array in Ascending Order? [1 = yes, 0 = no]: 1 Sorted elements in Ascending Order: 0 1 3 10 BUILD SUCCESSFUL (total time: 23 seconds)

Step by Step Solution

3.44 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 import javautilScanner class Main public static void main... View full answer

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 Programming Questions!