作业麻烦,伪代码

Homework trouble, pseudocode

我生病了,所以我错过了过去的 2 类,我想知道是否有人可以帮助我弄清楚如何解决这个问题,我可以研究一下并尝试理解它,我这个问题需要伪代码,我觉得我有点落后了:

The Vernon Hills Mail-Order Company often sends multiple packages per order. For each customer order, output enough mailing labels to use on each of the boxes that will be mailed. The mailing labels contain the customer’s complete name and address, along with a box number in the form Box 9 of 9. For example, an order that requires three boxes produces three labels: Box 1 of 3, Box 2 of 3, and Box 3 of 3. Design an application that reads records that contain a customer’s title (for example, Mrs.), first name, last name, street address, city, state, zip code, and number of boxes. The application must read the records until eof is encountered and produce enough mailing labels for each order.

将您列出的每个单独的步骤单独一行写下来,并在它们之间绘制箭头,以指示下一个步骤应该跟在一个步骤之后。

这将处理一个 "order"。由于一个订单可能包含多个盒子,因此请在这部分寻找可以 loop 的地方。向上画一个小箭头指向订单中单个盒子重新启动的右侧步骤。

在此图的末尾,您已经处理了一个 "order",因此现在寻找主循环应该在何处重新启动以及在什么条件下重新启动。

完成后你就有了一个流程图;一种纯粹的视觉辅助,您可以将其转化为伪代码(或者,就此而言,直接转化为具有正确命令的任何编程语言)。所以剩下的就是将图形箭头转换为适当的伪代码。