Question: Write a java program that initializes an array with random integers from (0 to 10). Arrange the randomly generated array in a decreasing order. Then

 Write a java program that initializes an array with random integers

Write a java program that initializes an array with random integers from (0 to 10). Arrange the randomly generated array in a decreasing order. Then print the sorted array and print out the number of different integers that were generated. Your code should be written using the following methods: 1- initArray(int array) 2- arrangcArray (int array[ D 3- printArray(int arrayll) 4- countNumbers(int array[I) /to count the different numbers in the array. should keep asking the user for the size of the The program array and stops when the user enters 0 Sample output Please enter the size of the array 10 The original random array is: The sorted array is: 9 9 8 8 8 7 7 5 2 0 There are 6 different numbers in the array Please enter the size of the array 6 The original random array is: 4 1 67 8 6 The sorted array is: 8 7 6 6 4 1 There are 5 different numbers in the array Please enter the size of the array 15 The original random array is: he sorted array is: 9 9 9 8 8 6 6 5 5 4 4 4 3 2 2 There are 7 different numbers in the array Please enter the size of the array 10 The original random array is: 7 8 2 0 6 0 1 3 4 6 The sorted array is 8 7 6 6 4 3 2 1 0 0 There are 8 different numbers in the array Please enter the size of the array: 0 Thank you

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!