Friday
April 18, 2014

Homework Help: comp.sci-python

Posted by seema on Monday, October 29, 2012 at 11:03pm.

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.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

comp sci - hi i am using java to make a quiz... i am using JFrame and have radio...
python 3 - For this option, first ask the user how many items there will be. ("...
computer science - I need to write a program that ask the student to enter an ...
programming - Using Raptor, create a condition loop that will ask the user for ...
math - There are 7 children who are 5ft long,their total length is 3ft longer ...
Literature - I am suppose to compare/contrast Monty Python and the Holy Grail ...
marketing opportunity cost - Maurice receives $100 as a birthday gift. In ...
principles of math 11 - if f(x)=2x =1 and g( x) =4x-3 then (f+g)(x)= options are...
Computer Programming - Java Programming Question: basically want to keep the ...
Language arts - Can someone give me an example of a metaphor? Is a mouse in ...

Search
Members