Question: Create a Java console program that satisfies the following: 1. The program prompts a user to enter a number. The program uses the input value

 Create a Java console program that satisfies the following: 1. The

Create a Java console program that satisfies the following: 1. The program prompts a user to enter a number. The program uses the input value to create an array with the number of elements based on the first input value. 2. The program asks the user to enter a series of numbers, and the numbers are to be entered and stored in the array. 3. The program asks the user whether the numbers are sorted in ascending or descending order. If the user selects the option of ascending order, the numbers are sorted in ascending order and displayed in a console window. If the user selects descending order, the numbers are sorted in descending order and displayed accordingly. 4. The program asks the user whether he/she wants to continue. If the user enters c or C, the program continues and repeats the process again. If the user enters any other key, the program stops. C:\JavaCode>java TomJones Enter a positive integer: 3 Enter item 1: 4 Enter item 2: 2 Enter item 3: 7 You have entered 4 2 7 The numbers in ascending order: 2 4 7 The numbers in descending order: 7 4 2 To continue enter c; to quit, enter any other key: c Enter a positive integer: 4 Enter item 1: 7 Enter item 2: 6 Enter item 3: 3 Enter item 4: 9 You have entered 7 6 3 9 The numbers in ascending order: 3 6 7 9 The numbers in descending order 9 7 6 3 To continue enter c; to quit, enter any other key: q C:\Javacode>

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!