X881: Jeroo lookForFlower()

For this question you will write a method that takes a jeroo named paige. Write an if statement to handle the following logic.

If paige already has a flower, she does nothing.

If she doesn't have a flower and can see a flower directly ahead, then hop and pick the flower.

Otherwise, if she doesn't have a flower and can see a flower to the left, then turn, hop, and pick the flower.

If none of the above apply, paige should do nothing.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.