Question: Write a Java program called Histogram.java that displays a list of distinct characters in an input tile and the occurrence of each eharacte. Your iogram

 Write a Java program called Histogram.java that displays a list of

Write a Java program called Histogram.java that displays a list of distinct characters in an input tile and the occurrence of each eharacte. Your iogram should 1ead an input file name from a use. After that, your program should read characters in the file and display a list of distinct characters and their occurTeces. Finally, your program should draw a veril bafo the occuences For the assignment, your program has.to display the result exactly as the sample run. For instance, when you display a list of character occurrences, your program should display the characters with more than zero occurrence in the ascending order. The height of the vertical bar should be the same as the maxium value of"Occurrence" And aksa the characters in th vertical bar should cone i te order of occurrences. In other words, since the characters from 'D' to 'K have occurrence 0, it comes first. After that, characters . A' and .C' come next because ther occurrences are Finally, 'Bs displayed because ts occurrence is 3. In the assignment, you can assume that the number of characters in the input file is less than 200. Yau can also assume that each line has only one character and there's no extra blank Furthermore, you can assume that all characters are capitals and from 'A' to 'K space after each character This is another sample run of your progranm: Input filenamei Ctmpt2.txt A sample run of your program MUST be like below: Input tilename: C:\\tnp\tl.txt Char Occurrence vertical Bar 12 I 12 For the sample un, tl.txt has the following context: For the sample t2. txt has the following context

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!