X918: While Loops with Relational Operators 2

For this question, we will be working with a subclass of Jeroo called CountingJeroo that tracks the number of hops it has peformed. You can get the number of hops performed so far by calling the getHopCount() method.

Below is a while loop with using a Jeroo named imani.

Currently, this loop will cause the jeroo to hop and toss a flower 10 times.

We want to change to change the condition for this loop so that the jeroo stops if it has hopped 10 times OR it is out of flowers.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.