Question: Write a method that has the following header: public static void printShuffled(String filename) The method reads a text file, filename, sentence by sentence into an

Write a method that has the following header: public static void printShuffled(String filename) The method reads a text file, filename, sentence by sentence into an array list, shuffles the sentences, and then prints out the shuffled contents. Assume sentences end with one ofthese characters:".", "!" and "?". Your method should create an array list for storing thesentences. The array list should be created with approximately the correct number ofsentences, instead of being gradually expanded as the file is read in. Write a test program that reads the attached story, txt file and prints its contents using your method. Sample output Now, the sons understood the meaning of the treasure. On his deathbed, the farmer told his sons that there was a great treasure buried in the vineyard. He wanted hissons to be just like him. They could not find a buried treasure. At harvest time, thevineyard produced the best grapes ever. After the farmer died, the sons went to thevineyard and dug up the soil. A farmer worked in a vineyard and became rich
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
