Pick All Flowers

Major Programming Topics

- Jeroo methods
- while structures
- if structures
- pre- and post-conditions

Statement of the Problem
It’s harvest time and Adam must pick all of the flowers on a rectangular island. Unfortunately for Adam, he doesn’t know where the flowers are growing. Flowers could be growing anywhere on the island. In order to keep from being too exhausted, he can only visit each cell once, and he cannot try to pick from an empty cell. There are no nets, water features, or other Jeroos on the island. The purpose of this program is to find a systematic way for Adam to visit every cell exactly once, and pick the flowers from the cells that have flowers.

Typical Starting View For This Program