Question: Finally, write a public instance method called performDance(), which takes no arguments and returns no value. The method should first check if any of the
Finally, write a public instance method called performDance(), which takes no arguments and returns no value.
The method should first check if any of the frogs are dancing. If there are no dancing frogs, the method should simply terminate; however, if there are one or more dancing frogs the method should proceed as follows:
First, the method should get the dancing frogs to do danceMove1.
Next, the method should check to see if numOfDanceMoves is greater than 1, and if it is the method should get the dancing frogs to do danceMove2.
Finally, the method should check to see if numOfDanceMoves is greater than 2, and if it is the method should get the dancing frogs to do danceMove3.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
