NOTES: Loops and conditions to control program flow part 2

Loops and conditions can be used in the Main method and in Jeroo methods.

WHILE Example: Kim picks all flowers in a line of flowers ahead, then turns left
as part of the main sub as part of an original method named pickRow
Sub main() 
    Dim Kim as Jeroo = new Jeroo( )
    While ___________________________
       Kim.hop()
       Kim.pick() 
    End While
    Kim.turn(LEFT)
End Sub 
Sub pickRow( )
 
 


End Sub 

Compound Conditions: AND, OR, NOT Using the examples, write the code for these conditions:

  1. If there is not a jeroo to the right of Lethia
  2. If Bernie has at least one flower and there is a net ahead of Bernie.
  3. If it is clear ahead or to the right of Liz
  4. If Dave is facing south and there is water to his left.

Nested control structures:

Copy the Final Version of the solution for this problem:

Remove all the nets on Jessica's right side as she hops all the way across the island.

 

 

 

 

Write a solution to this problem:

What if Jessica doesn't have enough flowers to disable all the nets? Perhaps on her way across the island she could pick any flowers that she passes while she is disabling the nets.