Friday
August 22, 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

Computers (Programming by Python) - Problem 1: Multiplication Drill Computers ...
computer science - I need to write a program that ask the student to enter an ...
computer science - Python 3 For this option, you will first ask "how many rows...
python 3 - For this option, first ask the user how many items there will be. ("...
programming - Using Raptor, create a condition loop that will ask the user for ...
programming - write a program that maintains two parallel arrays. after th ...
science - Write a complete C program that asks the user to enter continuously a ...
computer science /use java language - write the program that inputs a string ...
programming MIPS ask - Write a MIPS assembly language program that will cover ...
computer programming - : Create a program like KBC game show where program ask ...

Search
Members