Question: For this assignment, you will write a Java program that opens an input text file, manipulates the contents by reversing the order of lines, words

For this assignment, you will write a Java program that opens an input text file, manipulates the contents by reversing the order of lines, words within each line, and letters within each word, and writes the updated contents to a new output file.
Specifications:
The program should accept two command line arguments:
Input file name
Output file name
Use ArrayList to load contents and manipulate ordering
Reverse line order
For each line, reverse word order
For each word, reverse letter order
Write fully manipulated output to new file
Example:
Input Text File (mobydick.txt): MOBY DICK; OR THE WHALE
by Herman Melville CHAPTER 1
Loomings.
Output Text File: .sgnimooL
1 RETPAHC ellivleM namreH yb ELAHW EHT RO ; KCID YBOM
Make sure to include:
Import statements
Main method signature with command line args
Descriptive comments and method headers
This program challenges you to leverage ArrayList methods to logically traverse contents and reorder in multiple ways. The layered reversals build complexity. Think through the intended flow before coding.
 For this assignment, you will write a Java program that opens

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!