J
Joseph Meehan
I am feeling lazy today and my mind just does not want to work.
I need to compute the total interest for various time periods.
By law this interest is set each year for that year. It is chargeable
by day. A period that extends from one year to another will have a
different interest rate for the number of days in each year and that number
of days must be charged for the rate for that year. No compounding, just
simple interest.
Lets say interest rate of 10% for 1999; 15% for 2000 and 20% for 2001
So if the period was December 1, 1999 to January 31, 2001, there would
be three interest groups:
12-1-99 to 12-31-99
31(days) * 10%/365 = 0.85%
1-1-00 to 12-31-00
365 * 15%/365 - 15%
1-1-01 to 1-31-01
31* 20%/365 = 1.70%
Total = 17.55%
A special thanks to the one who comes up with the code. Bonus points
for code that uses a table as the source for the interest rates to allow
easy annual updates.
I need to compute the total interest for various time periods.
By law this interest is set each year for that year. It is chargeable
by day. A period that extends from one year to another will have a
different interest rate for the number of days in each year and that number
of days must be charged for the rate for that year. No compounding, just
simple interest.
Lets say interest rate of 10% for 1999; 15% for 2000 and 20% for 2001
So if the period was December 1, 1999 to January 31, 2001, there would
be three interest groups:
12-1-99 to 12-31-99
31(days) * 10%/365 = 0.85%
1-1-00 to 12-31-00
365 * 15%/365 - 15%
1-1-01 to 1-31-01
31* 20%/365 = 1.70%
Total = 17.55%
A special thanks to the one who comes up with the code. Bonus points
for code that uses a table as the source for the interest rates to allow
easy annual updates.