| Author |
text formatting using java
|
Ryan Speller
Greenhorn
Joined: Mar 01, 2008
Posts: 9
|
|
ok stuck on this one and looking for help before i say a word heres what I have so far and what I need to do: I think the comments sum up what I am doing, but I need help on the three TODO areas at the end. Basically the end product should have you entering a text file and then formatting it according to maxWidth. Started a new job this week 7am-6pm M-F so I am unbelievably exhausted and I just can't seem to figure out this last part and I know it should not be this hard. Any help is appreciated, any help in the form of code is god-like. Thanks
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32689
|
|
Go and find the "cattle drive" part of this website and find the example (I think 1a) which prints Gertrude 100 times. Several other people are struggling with a similar problem, or with the cattle drive example which prints Gertrude without going over the end of the line. Do a search of this forum for 1b; it was only a few days ago. What you need is to count the length of your ************************** line, count the length of line you have got to print out already, and if there isn't enough space for the next word, go onto a new line. Remember to allow for your spaces.
|
 |
 |
|
|
subject: text formatting using java
|
|
|