1. Engineering
  2. Computer Science
  3. hi i am a bit puzzled i need to put...

Question: hi i am a bit puzzled i need to put...

Question details

Hi, I am a bit puzzled. i need to put the list of instructions for 1-9 in the blank spaces.

Each of the following four problems consists of a mixed up set of instructions which, when put in proper order, step by step method of performing a task. Can you put the instructions in the correct order by writing the correct step number in each blank?

1. A procedure is needed to change all the traffic lights in a small town for one cycle only. Lights that are red must be changed green and lights that are green must be changed to red. (no yellow lights and there are no lights that aren't working). Assume that you have a street map that shows the location of all the lights. The "go to" statements will help you avoid ending up all the lights the same color.

____ Find a light on your map that is not marked "done" and check whether it is red or green.

____ turn the light red.

____If there are lights on your map not marked "done", the go to the next step; otherwise, go to step ____.

____ if the light is green, then go to the next step; otherise go to step ____

____ on your map, make the light you just changed as "done."

____ go to step ____.

____ go to step ____.

__9_ End.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution