A common task in word processing is to reformat input text into a more structured format to match english grammar. For example, there should be a sinple space following a comma, two spaces following a period, and the first word in each sentence should be captilized. Furthermore, text can be aligned either left, right, center, or fully justified to look "better" when scanned down a page.
This assignment is to write a program that takes command line arguments for input file, output file, and formatting options then produce the output file based on formatting rules.
All input text should be processed by the following rules:
Example Input: See image.
Issues: See image.
Text can also be left, right, center, or fully justified. Most text that you read is already left justified.
Input text: See image.
Output text justified to 33 columns(your code will justify to 72 columns)
Left Justified text: See image.
Right justified text: See image.
Center justified text: See image.
Fully justified text: See image.
Note that you should not line breaking or reduce spacing between words while performing justification. However, you are permitted to add or remove spaces at the start of each line and add additional spaces between words(for full justification). Your program should take a third argument to specify justification.
Example command line usage:
Java Program3 input.txt output.txt -center