问题4304--Calculate the total amount of the money after 30 years for the invested principal

4304: Calculate the total amount of the money after 30 years for the invested principal

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 128 MB

题目描述

The mathematical formula for the total amount of the money invested with the interest compounded
annually is
y = p(1 + r )n
where y is the total amount, p the principal invested, r the interest rate, and n the number of years. Write
a program to calculate the total amount of the money after 30 years for the invested principal of $10,000
with an 8 percent interest rate.

来源/分类