JAVA Assignment: Project File Processing. Write a program that will read in from input file one line...

90.2K

Verified Solution

Question

Programming

JAVA Assignment:

Project File Processing.

Write a program that will read in from input file one line at atime until end of file and output the number of words in the lineand the number of occurrences of each letter. Define a word to beany string of letters that is delimited at each end by eitherwhitespace, a period, a comma or the beginning or end of the line.You can assume that the input consists entirely of letters,whitespaces, commas and periods. When outputting the number ofletters that occur in a line, be sure to count upper and lowercaseversions of a letter as the same letter. Output the letters inalphabetical order and list only those letters that do occur in theinput line. For example, the input line:-I say HI should produceoutput similar to the following:-

3 words

1 a

1 h

2 i

1 s

1 y

Please Note!!!!!: in addition to the above,output the result to file named “result.txt”

Answer & Explanation Solved by verified expert
4.5 Ratings (787 Votes)
Program In this program we read in a textfile for each line we calculate the number of words in that lineand then for each character of each word we find the frequency ofthe character We write the information gathered into an outputfile The words in a line are splitted based on differentdelimiters commas periods spaces exclamations marks etcBelow is the    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students