Today's Friday Puzzler (it's been a while - sorry!) is from LessThanDot: How many days before I double my money. Their problem was: Given 1000 dollars and 1% interest every day - now long until you double your money. Since ColdFusion makes everything simpler, I'm going to make this a bit more complex. Your challenge is to write a generic UDF that:

  • Takes in an initial balance
  • Takes in a percentage interest value
  • Takes in a desired total

Given the parameters above, your UDF will return how many days it takes to go from the initial balance to the total. If you want - just write the UDF. If you're bored - write a program that will chart out the balance growth every day.

Want some incentive? The best entry will get a 20 dollar gift certificate. "Best" will be 100% subjective and probably unfair.