For this option, first ask the user what the maximum number of columns for printing will be. ("How wide should

the output be?") Next, the user will enter in a paragraph of text. They may enter it in as many lines as they'd like, and the only way you know they are done typing is that they will enter a completely blank line. Once you have all the output, you can assemble it into the output: each "word" should either fit on the current line within the maximum number of columns, or else you must put the word on the next line and fill the current line with spaces up to the given width.
• a "word" means anything between spaces. he's...multi-­‐tasking
on "Sunday" has five words.
• words at the end of one line and the beginning of the next must stay separate words (even though you
might not receive a space at the end of the first or beginning of the second line).
• multiple spaces should be replaced with a single space.
• tabs should be treated like space characters.
• place vertical bars on both edges of the text. They do not count towards the max width, but make it
clearer where the border of your document is.
• if a word cannot fit on a line at all, then put as much as you can on the line while still putting a hyphen as the last character on that line, and then continue with the rest of the word on the next
line.
• Modify your word-wrap option so that instead of having the user enter in the text directly, they enter the filename of the text file where the contents should be found. This will allow for
multiple paragraphs; preserve each empty line as a full-width line.

To achieve this option, you can follow these steps:

1. Ask the user for the maximum number of columns for printing. Display a prompt like "How wide should the output be?" and retrieve their input.

2. Ask the user for the filename of the text file containing the paragraphs to be printed. Display a prompt like "Enter the filename of the text file to process:" and retrieve their input.

3. Read the contents of the specified text file. You can use file input/output operations to open the file, read its content, and store it in a variable.

4. Split the content of the file into paragraphs. A paragraph is defined as a block of text separated by empty lines. You can split the content by using regular expressions or by iterating through the text and checking for empty lines.

5. Process each paragraph individually. For each paragraph, perform the following steps:

a. Initialize an empty string variable to store the formatted output.

b. Split the paragraph into individual words. You can use spaces or tabs as separators and remove any leading or trailing spaces.

c. Iterate through each word. For each word, do the following:

- Check if the current line's length plus the word's length (including spaces) exceeds the maximum number of columns. If it does, add a newline character to the output and start a new line.

- Check if the word can fit in the current line. If it can, append the word to the output, followed by a space character.

- If the word exceeds the maximum number of columns, add as much of the word as possible to the current line, appending a hyphen as the last character. Then, add a newline character to start a new line and continue with the remaining part of the word.

d. Once all words have been processed, append a newline character to the output to start a new line for the next paragraph.

6. Format the final output. Add vertical bars to both edges of each line by concatenating a vertical bar character at the beginning and end of each line. This will create a border for the document.

7. Print the final formatted output to the console.

By following these steps, you will be able to implement the option of processing a text file with multiple paragraphs and formatting it based on the specified number of columns.