Java Reference
In-Depth Information
Start
I = 1
J = 4
J = J + 1
No
I > J
I = I + 2
Yes
No
J = J + 3
J > 10
Yes
End
FIGURE A-25
6. Draw one flowchart, and only one, that will cause the mechanical mouse to go through any of the
four mazes shown in Figure A-26. At the beginning, a user will place the mouse on the entry side
of the maze, in front of the entry point, facing up toward the maze. The instruction Move to next
cell will put the mouse inside the maze. Each maze has four cells. After that, the job is to move
from cell to cell until the mouse emerges on the exit side. If the mouse is instructed to Move to
next cell when a wall is in front of it, it will hit the wall and fall apart. Obviously, the mouse must
be instructed to test whether it is Facing a wall before any Move . The physical movements and
logical tests the mechanical mouse can complete are listed following Figure A-26.
MAZE 1
MAZE 2
MAZE 3
MAZE 4
Exit
Exit
Exit
Exit
Entry
Entry
Entry
Entry
FIGURE A-26
(continued)
 
Search WWH ::




Custom Search