Question: Exercise 3 (section 30): 1) Consider the task of fully justifying a paragraph of text to a target length, by putting as many words
Exercise 3 (section 30): 1) Consider the task of fully justifying a paragraph of text to a target length, by putting as many words as possible on each line and evenly distributing extra spaces so that each line has the target length. Devise a plan for writing a class that take a paragraph of text and prints it fully justified. What a proper name of such class? What methods should be applied to achieve the goal of the class? 2) Document your class(s). 3) Provide a tester class and test a scenario in which you read at least three paragraphs and use the implemented class to print them as fully justified paragraph in an output document/text file. Try with different length of paragraphs.
Step by Step Solution
3.43 Rating (166 Votes )
There are 3 Steps involved in it
1 I would name the class TextJustifier It should have methods like initself targetlength to initiali... View full answer
Get step-by-step solutions from verified subject matter experts
