Compound Interest
Write a program to compute the value of an investment compounded over time.
The formula for compound interest is:
A = P (1 + r/n) ^ (nt)
where:
Pis the principal amount,ris the rate per period,tis the number of years invested,nis the number of times the interest is compounded per year,Ais the amount at the end of the investment.
The program is a simple translation from the formula to code.