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:
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.
|