Harold is standing in front of a flowerbed that contains six flowers, as illustrated in Figure 1-13.

Question:

Harold is standing in front of a flowerbed that contains six flowers, as illustrated in Figure 1-13. Create an algorithm that directs Harold to pick the flowers as he walks to the other side of the flowerbed. He should pick all red flowers with his right hand. Flowers that are not red should be picked with his left hand. Use only the instructions shown in the figure; however, an instruction can be used more than once. Be sure to create an algorithm that will work for any combination of colored flowers. 


Harold should end up on the other side of the flowerbed else end if end repeat if (the flower is red) pick the flower with your left hand pick the flower with your right hand repeat (x times) walk forward one complete step Figure 1-13

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: