Design, code and test a Java program which will perform the following:
Read in a series of positive integers in the range of 1-100 (terminated with a negative number) and report the frequency of each number input. For example, the following input:
5 8 5 90 5 8 90 8 16 -#
would result in the following output:
90: 2 16: 1 8: 3 5: 3
Note the report is in descending order and reports only those numbers that have been entered.
File I/O can be performed using the class file FileIn.class. A sample routine that employs the methods necessary for the open, read and close operations can be found in TestFileIn.java. Sample data set assn7.txt.
Did you try it, yet? I think an answer to this exact question (probably someone in your class or from last semester) was posted in this forum a while back. It's very easy to do using a HashMap.