Create a Flowchart
Construct a flowchart for an algorithm to make a mechanical man, who is
sitting in a chair facing a wall: 1) stand up, 2) walk to the wall and
touch it and 3) return to his chair and sit down.
The mechanical man possesses the following properties:
1. He is restricted to a limited set of operations.
2. He is event-driven (doing nothing unless given a specific
instruction).
3. He must carry out instructions one at a time.
4. He understands the following instructions:
a. Physical movement:
(1) Stand
(2) Sit
(3) Take one step forward
(4) Raise arms straight ahead
(5) Lower arms to sides
(6) Turn right (90 degrees without taking a step)
b. Arithmetic:
(1) Add one to a running total
(2) Subtract one from a running total
(3) Store a total (any number to totals can be stored)
c. Logic:
The mechanical man can decide what instruction he will carry
out next on the basis of answers to the following questions:
(1) Arithmetic results
(a) Is the result positive?
(b) Is the result negative?
(c) Is the result zero?
(d) Is the result equal to a predetermined amount?
(2) Physical status
(a) Are the raised arms touching anything?
