Sam invested $10,000 and earned 20% interest compounded for 3 years. He then invested more until he had three times as much invested. The next year, he got a 15% return on his investment. How much money does he have now?
After one year, Sam had $10,000 * 1.2 = $<T>multiply(10000, 1.2)=12000.0.
After two years, he had $12,000 * 1.2 = $<T>multiply(12000, 1.2)=14400.0.
After the third year, he had $14,400 * 1.2 = $<T>multiply(14400, 1.2)=17280.0.
He then invested more money until he had 3 * $17,280 = $<T>multiply(3, 17280)=51840.
The first year after that, he had $51,840 * 1.15 = $<T>multiply(51840, 1.15)=59615.99999999999.
,616