Write a program that reads a file and displays a histogram to show the occurrences of each

Question:

Write a program that reads a file and displays a histogram to show the occurrences of each letter in the file, as shown in Figure 16.40b. The file name is entered from a text field. Pressing the Enter key on the text field causes the program to start to read and process the file and displays the histogram. The histogram is displayed in the center of the window. Define a class named Histogram that extends Pane. The class contains the property counts that is an array of 26 elements. counts[0] stores the number of A, counts[1] the number of B, and so on. The class also contains a setter method for setting a new counts and displaying the histogram for the new counts.image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: