Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in java which prompts the user for an input and output text file as well as an integer n which serves as

Write a program in java which prompts the user for an input and output text file as well as an integer n which serves as a line width. It should them read the text from the input file, reformat the text, and then print it to the output file. The reformatting should be as follows:

All lines should be exactly n characters long

Text in all but the last line should be both left and right justified. The last line should just be left justified.

Spaces used to create the right justification should be as uniformily spaced as possible

You must include in your comments in the program the method you used to uniformly distribute the spaces in the output. You should handle any FileNotFoundException without exiting the program.

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

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

Explain the purpose of heartbeat queries.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago