Challenge problems using loops
A Jeroo starts out in the middle of an island at (12,12) with 4 flowers. It must use it's flowers to break out of the encircling nets to reach the outer shore of the island. The program must use loops in the solution. Create a method called findNet() that tells a Jeroo to keep hopping until it is facing a net. Create a method called throughNet() that tells a Jeroo to use the findNet() method to find a net and then to toss a flower at the net to disable it. Fill out the TAG sheet when finished. |
Connect-the-dots. (uses islands Dot1 and Dot2)
Print code with GOOD STYLE. (comments, indentation, good method names) |
| MineSweeper. A jeroo with 46 flowers in its pouch travels across an island one time from East to West disabling every net it finds in its path and replacing the net with a flower (first, toss a flower at the net to disable it, then hop forward and plant another flower to replace the net). Create a method called replaceNet() and another method called findNet() . The main program must use a loop to continuously find and replace nets until the shore is reached. This should work for any island. Save as MineSweeper. |