I am currently having extreme difficulty starting to write program for my java class. I've been struggling with this first java class and if anyone could shed some light and help me I would aprreciate it very much. I have to create a program where any number of input lines is put in by the keyboard and using arrays i have to count the frequency of each letter, put it to lowercase, and print out the number of times each letter occurs. The two classes im using is the driver class LetterFreq and the class Letters. I don't know where to start and am wondering if anyone can help. I don't really have any code besides declaring the classes and main so any help or starting point would be appreciated.

11-06-2009, 12:29 AM

bubbless

You can make two arrays.
One with 26 strings/chars (a-z) and one with 26 int's. (letter counts)

When the user inputs a letter, add one to the int array.
In the end, display the int for each letter.

11-06-2009, 03:55 AM

Eranga

First start from how the user input handle. Have to find out what type of character is entered by the user, letter or a character. If it's a character then you have to convert then into a lowercase. It's really easy task to do. Then as bubbless say you can do a simple comparison.

Take a start and show your effort here. Then we can comment on each step.

11-06-2009, 06:40 PM

SF163

I've got thhis for the driver class so far but I don't know if its reading in the way I want it to.