You need to pack some books in cardboard boxes. Design a program which measures the volume of boxes by accepting as input W (width), H (height), B (breadth). Since only positive integer values are permitted assume that you have a subprocess called Input_Positive_Integer and use it. You don't have to write the pseudocode for this subprocess. The permissible range of volumes is 100 volume units to 600 volume units inclusive. Any box outside this range is rejected. Any box outside this range is rejected. The books you are packing amount to 6000 volume units in total.
Total_Volume = 0
|
I'm assuming now that you have a good grasp of the strategy we are using to design algorithms so I have left that out. You can see that I just CALL the subprocess to get integer values and assume that the subprocess is available somewhere. |
This publication is copyright David Beech and Learning Systems 1997-2002
and may not be reproduced by any means without the written permission of
David Beech.
9 Wyndella Street, Tasmania, Australia