A popular speechwriter has recently decided to offer an additional service to her clients. She will transfer the text of the speeches she develops for them onto a series of 3"×5" index cards which they can then use during their presentation. Since she uses a 12-point monospaced font for visual clarity, she is able to get 18 lines of 50 characters onto each card.
Many of her clients prefer to have some room reserved for notes on the top, bottom, or both top and bottom of each index card so that they can add last-minute comments or jot down a few related thoughts with the text on the front of the card just before delivering the speech. Consider the structure of each card as conveyed by the diagram below:
The speechwriter is especially concerned about formatting the index cards to avoid four potential typographical miscues that can affect the number of index cards necessary and, more importantly, their readability for the speaker. These are:
Write a program that will assist the speechwriter by accepting a set of margin parameters and the text of a speech and output a format report detailing which of these typographical miscues will occur if the text is transcribed without further modification onto 3"×5" index cards.
widow
, orphan
,
leading blank line
, or trailing blank line
)
or the letters OK
if none of these formatting errors is
present. Should multiple formatting errors occur on a single index
card, these errors must be indicated across the output line in the
order in which they occur on the card (top to bottom), with each error
separated by a comma and a space from the one preceding it. Refer to
the example on the next page.
3 5 Why multiprocessing? Some computer systems employ a uniprocessor approach, in which a single processor performs the work. Multiprocessing systems (systems that employ two or more processors) offer a number of advantages over uniprocessors. The most obvious is speed. In theor, if a single processor can solve a problem in a given length of time, two identical processors working together should be able to solve the same problem in half of the time. In practice, the nature of the problem of the design of the multiprocessing system may not provide such an ideal result. But there are many applications which show nearly linear speedups in processing speed as more processors are provided. Potential speedups from multiprocessing are even more attractive in light of recent developments in technology. The preformance of processors is increasing, while their price is dropping. System performance is being boosted by improvements in hardware design and programming techniques. Multiprocessing also offers a level of system reliability not found in uniprocessor system. If a processor fails, it can be quickly deconfigured while the remaining processors pick up its work. There are two basic approaches to multiprocessing evident in commercial systems today. Distributed memory multiprocessor systems usually consist of from eight to several thousand processors, each of which has its own memory. Processors typically communicate with each other only to read initial code and data, and to write final results. This is termed loose-coupling. The other common approach is called the shared- memory approach. These systems typically employ 2 to 30 processors and use a common memory, all linked by a high-speed bus. This design is called tightly-coupled, since the processors must all coordinate their access to the common memory.
Index Card #1: OK Index Card #2: orphan Index Card #3: trailing blank line Index Card #4: widow Index Card #5: OK