Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In JAVA how do you open the file reading in each line as a String, store each String in an ArrayList. - If a FileNotFoundException

In JAVA how do you open the file reading in each line as a String, store each String in an ArrayList. - If a FileNotFoundException is thrown catch the exception and alert the user of the error. Find the alphabetic character that occurs the most in each sentence in the file, only consider alphabetic characters, treat lowercase and uppercase as the same character - For example if the input is "Hi how are you" the character H occurs twice - Assume that one alphabetic character will repeat more than the others - The sentence will only have one alphabetic mode. - Use the method findMode

(The main method cannot be set to throw any exceptions. The text file will contain multiple lines and each line will correspond to a single sentence.)

Sample Output:

Ex: If input is: anexample.txt

the output is:

Please enter the name of the file: The Character 0 occurs 5 times. The Character I occurs 5 times.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

What is comparative advantage?

Answered: 1 week ago