A company handles international messages. Currently, the messages are printed onto a
continuous strip of paper which is cut up and pasted onto sheets of paper for delivery.
The owner of the company has decided to automate this process, printing the messages
directly onto sheets of paper. Your task is to develop a pseudo code algorithm to achieve
The owner can tell you the following things:
The incoming message arrives in the form of a series of one or more blocks of data.
The outgoing message will be produces as a series of pages.
Each page may contain up to 60 lines.
Each line can contain up to 100 characters.
Words may not be split across lines.
As many words as possible must be fitted onto each line.
Each message must start on a new page.
You have 3 sub-programs already provided.
getBlock which fills an array with the next incoming block of text.
putLine which prints the next line of text onto the page.
putPage which ejects the current page and starts the next.
You should design a solution in which the algorithm is clear and easily tested.
Here is the extra information you needed to elicit in tutorial discussions:
Each block can hold up to 500 characters.
The end of a block is designated by the character #.
The 500 character limit includes the end of block character.
The end of a message is designated by an empty block.
An empty block consists of a one-character long block containing # (for simplicity).
The character # only appears as the end of a block.
A message consists of a series of words.
Words are separated by spaces, or sequences of the (empty space) character.
The alphabet consists of the capital letters A to Z and the space .
Numbers and punctuation are spelled out, i.e. COMA FULLSTOP QUESTION MARK.
On arrival, the first word of a message may have one or more spaces before it.
On arrival, the last word of a message may be followed by one or more spaces.
On Arrival, there may be multiple spaces between words.
Blocks may consist entirely of spaces.
On arrival, words may be split between blocks.
On output there must be no space before the first word on any line.
On output there will be no more than 1 space between words.
No word in the message will be longer than 100 characters.
I need to create these following question below with using the information above:
- A Pseudocode algorithms
- Also Flow charts 1 Main control algorithms and minimum 4 sub-algorithms
I need help cause im confused on how to do it :S can someone help me please