X922: Practicing Conditionals 3

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 access the number of hops performed so far by running the getHopCount() method.

You will have access to a CountingJeroo object named leon and an integer value.

Write a series of conditions to handle the following logic:

  • If the variable value equals 7, the jeroo should hop 7 times.
  • If the variable value equals 13, the jeroo should hop 13 times.
  • Otherwise, the jeroo should turn left four times.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.