graph TD
accTitle: Produce a replenishment message from current stock
accDescr: Start, input Stock Units, test whether Stock Units is at most five, output Reorder on the Yes branch or Stock sufficient on the No branch, and then end.
Start(("Start")) --> Input[/"Input Stock Units"/]
Input --> Decision{"Is Stock Units <= 5?"}
Decision -- "Yes" --> Reorder[/"Output 'Reorder'"/]
Decision -- "No" --> Sufficient[/"Output 'Stock sufficient'"/]
Reorder --> End(("End"))
Sufficient --> End
Which pseudocode is equivalent to the flowchart?
Stock Units is the number of items currently available. It is a whole number that can be zero. The flowchart in Figure 1 produces one message. At the diamond, follow the arrow labeled with the answer to its Yes/No question. The symbol <= means “less than or equal to”. Input reads the supplied number, and Output reports the message.
Which pseudocode produces the same single message as the flowchart for every permitted input? An equivalent algorithm may phrase the decision differently.