This discussion is archived
9 Replies Latest reply: Jun 4, 2007 8:43 PM by 807600 RSS

JAVA  File handling. ( Urgent  Response Appreciated)

807600 Newbie
Currently Being Moderated
Hi I'm pretty new to Java. I would appreciate if any one could write programme for me for the below scenario:

Write a Java program which accepts the name of a text file, reads in that file, and prints out the following information about the file:

1. a list of all letters (A through Z) in that file, disregarding case (e.g. count ?a? and ?A? as two occurrences of the letter A), ordered with the most frequently used letter first and the least frequently used letter last, along with the number of times each letter was used,

2. an alphabetized list of all distinct words in that file with the number of times each word was used,

3. the average number of letters in a word, and

4. the average number of words in a sentence.

Use the following example paragraph to set up your test input text file:

Any experienced programmer engaged in writing programs for use by others knows that, once his program is working correctly, good output is a must. Few people really care how much time and trouble a programmer has spent in designing and debugging a program. Most people see only the results. Often, by the time a programmer has finished tackling a difficult problem, any output may look great. The programmer knows what it means and how to interpret it. However, the same cannot be said for others, or even for the programmer himself six months hence.