求一道題目的算法偽代碼
求一道題目的算法偽代碼
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
this purpose. The owner can tell you the following things:
1. The incoming message arrives in the form of a series of one or more blocks of data.
2. The outgoing message will be produces as a series of pages.
3. Each page may contain up to 60 lines.
4. Each line can contain up to 100 characters.
5. Words may not be split across lines.
6. As many words as possible must be fitted onto each line.
7. Each message must start on a new page.
8. You have 3 sub-programs already provided.
a. getBlock which fills an array with the next incoming block of text.
b. putLine which prints the next line of text onto the page.
c. putPage which ejects the current page and starts the next.
9. Each block can hold up to 500 characters.
10. The end of a block is designated by the character ‘#’.
11. The 500 character limit includes the end of block character.
12. The end of a message is designated by an empty block.
13. An empty block consists of a one-character long block containing ‘#’.
14. The character ‘#’ only appears as the end of a block.
15. A message consists of a series of words.
16. Words are separated by spaces, sequences of one or more occurrences of the ‘ ’
character.
17. The alphabet consists of the capital letters ‘A’ to ‘Z’ , the space ‘ ’ and the hash ‘#’.
18. Numbers and punctuation are spelled out
19. On arrival, the first word of a message may have spaces before it.
20. On arrival, the last word of a message may be followed by spaces.
21. On Arrival, there may be multiple spaces between words.
22. Blocks may consist entirely of spaces.
23. On arrival, words may be split between blocks.
24. On output there must be no space before the first word on any line
25. On output there will be no more than 1 space between words
26.No word in the message will be longer than 100 characters.
You should create a solution in which the Algorithm is clear and easily tested.
Use the principles of top-down design and modular programming.
Select one of the sub-algorithms you create and provide a detailed flow chart for it following
the rules and conventions taught in class.
給出了26個條件,讓寫偽代碼,不要求有全部答案,有個大概思路就好
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
this purpose. The owner can tell you the following things:
1. The incoming message arrives in the form of a series of one or more blocks of data.
2. The outgoing message will be produces as a series of pages.
3. Each page may contain up to 60 lines.
4. Each line can contain up to 100 characters.
5. Words may not be split across lines.
6. As many words as possible must be fitted onto each line.
7. Each message must start on a new page.
8. You have 3 sub-programs already provided.
a. getBlock which fills an array with the next incoming block of text.
b. putLine which prints the next line of text onto the page.
c. putPage which ejects the current page and starts the next.
9. Each block can hold up to 500 characters.
10. The end of a block is designated by the character ‘#’.
11. The 500 character limit includes the end of block character.
12. The end of a message is designated by an empty block.
13. An empty block consists of a one-character long block containing ‘#’.
14. The character ‘#’ only appears as the end of a block.
15. A message consists of a series of words.
16. Words are separated by spaces, sequences of one or more occurrences of the ‘ ’
character.
17. The alphabet consists of the capital letters ‘A’ to ‘Z’ , the space ‘ ’ and the hash ‘#’.
18. Numbers and punctuation are spelled out
19. On arrival, the first word of a message may have spaces before it.
20. On arrival, the last word of a message may be followed by spaces.
21. On Arrival, there may be multiple spaces between words.
22. Blocks may consist entirely of spaces.
23. On arrival, words may be split between blocks.
24. On output there must be no space before the first word on any line
25. On output there will be no more than 1 space between words
26.No word in the message will be longer than 100 characters.
You should create a solution in which the Algorithm is clear and easily tested.
Use the principles of top-down design and modular programming.
Select one of the sub-algorithms you create and provide a detailed flow chart for it following
the rules and conventions taught in class.
給出了26個條件,讓寫偽代碼,不要求有全部答案,有個大概思路就好
英語人氣:661 ℃時間:2020-05-17 09:28:54
優(yōu)質(zhì)解答
這道題我包了,其他人速速退散.明天告訴你答案.當(dāng)然只是思路,我從來都是給人漁,而不是魚.我睡好了,現(xiàn)在來回答你的問題,感謝樓上的支持!順便感慨一下老外出的題就是高明,我上學(xué)時候沒有這么好的題來引導(dǎo)學(xué)生.先看題目,...
我來回答
類似推薦
- 用偽代碼表示求1^3+3^3+5^3+……+1001^3的一個算法
- 關(guān)于算法題兩道,用偽代碼,
- 英語翻譯
- 算法偽代碼 執(zhí)行循環(huán)次數(shù)的問題
- 寫出求1+3+5+7+9+.+99的一個算法的偽代碼
- i believe that that that that that student says is right.
- 薄煙的薄應(yīng)該怎么念?這個字的兩種讀音又該怎樣分辨?
- 一九七九年那是一個春天,有一個老人在中國南海邊……
- i used to think that i could not go on的手語
- 文言文題目【王充市肆博覽】
- 翻譯句子:如果明天下雨怎么辦?用What if.(另外,what if后面用陳述語序,必須用一般現(xiàn)在時態(tài)嗎?)
- 怎樣寫自然景觀
猜你喜歡
- 19分之8×10分之3 還有3分之1×4分之1還有6×12分之11
- 2用exercise和dress的適當(dāng)形式填空 (請看問題補充)
- 3甲乙丙三位同學(xué)都喜歡集郵,甲有郵票18張,相當(dāng)于乙的3/4,丙的郵票張數(shù)跟乙的張數(shù)的比恰好是2:3
- 4Everyone is busy() ready for Christmas A.to get B.getting C.got D.gets
- 5函數(shù)不能嵌套定義是什么意思
- 6幫忙解答下《假如你想做一株臘梅》有關(guān)題目
- 7形容兩個人的感情幸福的四字成語
- 8某班7個興趣小組人數(shù)分別為3,3,4,x,5,6,已知這組數(shù)據(jù)的平均數(shù)是4,則這組數(shù)據(jù)的中位數(shù)是?
- 9東南亞的主要礦產(chǎn)和分布?
- 10根據(jù)所給的首字母提示,用合適的單詞填空,
- 11Could you tell me ___ with the money?A hou to do B what should I do C how should I do
- 12“小大之獄,雖不能察,必以情”與“忠之屬也”之間的內(nèi)在聯(lián)系是什么