Question: Write a public instance method called createDance(), which takes no argument and returns no value. The method should first check whether any frogs have been
Write a public instance method called createDance(), which takes no argument and returns no value. The method should first check whether any frogs have been selected to perform a dance. If no frogs have been selected, the method should simply terminate; however, if one or more frogs have been selected, the method should do the following:
First, prompt the user for the number of dance moves and assign the returned value, which will be between 1 and 3 inclusive, to numOfDanceMoves.
The method should then prompt the user to enter the name of a dance move ("flip"or "slide") and assign that dance move to danceMove1.
Next the method should check to see if numOfDanceMoves is greater than 1 and if it is prompt the user to enter the name of a second dance move and assign it to danceMove2.
The method should then check whether numOfDanceMoves is greater than 2 and if it is prompt the user to enter the name of a third dance move and assign it to danceMove3.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
