Logout

Old Lady Recursive Problem-Solving

 

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

******* Note that this needs to be re-written, so that the initial call is to swallow(cow), or better yet, swallow(horse) - "she's dead of course..."

This is because the recursive situation is actually that a little old lady swallowed a horse (and is consequently now dead). Why did she swallow a horse is the unanswered question. And the only way to get to the bottom of this case is to keep on asking the "why did she swallow a..." question, until there is a reasonable answer (noting that little old ladies do indeed, at times, swallow flys which inadvertently buzz into their mouths).

And note that for the print out to work, the position of the println( ) will have to be moved within the swallow( ) method.