Write a program that reads numbers from the keyboard into


Write a program that reads numbers from the keyboard into an array of type int[].

You may assume that there will be 50 or fewer entries in the array.

Your program should allow any number of numbers to be entered, up to 50.

The output is to be a 2 column list.

The first column is a list of the distinct array elements, the second column is the count of the number of occurrences of each element. The list should be sorted on entries in the first column, largest to smallest(can you do that without a sort???). You can try an ArrayList for practice. I have a lots of alternative ideas, on how to do this, if you have another idea, try it.

For the array:
-12 3 -12 4 1 1 -12 1 -1 1 2 3 4 2 3 -12
the output should be

Number   Count
4   2
3   3
2   2
1   4
-1    1
-12   4

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program that reads numbers from the keyboard into
Reference No:- TGS02374260

Now Priced at $15 (50% Discount)

Recommended (98%)

Rated (4.3/5)