Problem #2: Given a scenario with a princess and a dragon.
- Write a class-level method, called shakeHead, for dragon to shake his head. This method must have a Number parameter. If the number parameter has the value 1, then the dragon shakes his head up and down (i.e. meaning yes).Else, if the number parameter has another value, then the dragon shakes his right to left (i.e. meaning no).
- Next, make the princess ask the dragon some questions:
- Are you a guy dragon? Dragon replies by shaking his head yes.
- Did you kill the wizard? Dragon replies by shaking his head yes.
- Are you gonna eat me lor? Dragon replies by shaking his head no.