logo Practice-It logo

BJP4 Exercise 6.10: wordWrap2

Language/Type: Java file processing Scanner
Author: Jared Jones (on 2016/09/08)

Modify the preceding wordWrap method into a new wordWrap2 method that accepts a second parameter for a PrintStream to write the data, and outputs the newly wrapped text to that PrintStream rather than to the console. Also, modify it to use a local variable to store the maximum line length rather than hard-coding 60. (You can go back to the last problem to copy your solution code from there and paste it here as a starting point.)

Type your solution here:

This is a method problem. Write a Java method as described. Do not write a complete program or class; just the method(s) above.

You must log in before you can solve this problem.

Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.