Question: Create a recursive method that counts down from a given number to zero in a fun way. The method will print each number followed by
Create a recursive method that counts down from a given number to zero in a fun way. The method will print each number followed by a fun message, and when it reaches zero, it will print "Blast off!" like a rocket launch.Requirements:Write a recursive method magicCountdownint n that:Prints the current number followed by a fun message eg is still counting..."Recursively calls itself with n until it reaches zero.When n reaches zero, the method should print "Blast off!".In the main method:Prompt the user to input a starting number.Call the magicCountdown method using the userprovided number.Make sure your program handles both positive and zero as valid inputs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
