Question: Input: One fish Two fish Red fish Blue fish. Black fish Blue fish Old fish New fish. This one has a little star. This one

Input: One fish Two fish Red fish Blue fish. Black fish Blue fish Old fish New fish. This one has a little star. This one has a little car. Say! What a lot Of fish there are. 

Output:

One fish Two fish Red fish Blue fish . Black fish Blue fish Old fish New fish . This one has a little star . This one has a little car . Say ! What a lot Of fish there are . 

Implement method:-1. public static void readInputFile(String fileName,ArrayList< ArrayList > fileByLine) throws IOException

Steps to parse input file in readInputFile: a. Read in the file line by line

b. For each line, split it into words based on whitespace using either String.split or Scanner.

c. For each word, go character by character to separate the letters and apostrophes from the other punctuation.

2. public static void display(ArrayList< ArrayList > fileByLine, ArrayList< ArrayList > modFileByLine, boolean modeBoth) throws Exception

Specifically, the method should (regardless of the value of modeBoth) produce the output as if modeBoth is false.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!