I am really having a hard time wrapping my head around function recursion. Why use it when you can use loops many times, what are the advantages to it? Also, I am lost as to how to solve this recursion practice problem I am trying:
"Though the program below does not necessarily require recursive solutions, it is good practice to create recursive methods so that you learn to program them.
A child is looking for 4 toonies. He starts by randomly pulling 4 coins out of a bag that he cannot see into. He can exchange one coin at a time; that is, he can put one coin back into the bag and then pull out another one. He never keeps more than 4 coins. The possible coins that he can pull out of the bag are a penny, a nickel, a dime, a quarter, a half-dollar piece, a loonie, or a toonie. His goal is to end up with 4 toonies.
Write a program called RecursionCoin that makes use of a recursive method to help him reach his goal. Keep track of how many attempts it takes to reach his goal. "