admin管理员组

文章数量:1558098

*5.30(金融应用:复利值)假设你每月在储蓄账户上存100美元,年利率是5%。那么每月利率是0.05 / 12 = 0.00417。

在第一月之后,账户上的值变成:
100 * (1 + 0.00417) = 100.417
第二个月之后,账户上的值变成:
(100 + 100.417) * (1 + 0.00417) = 201.252
第三个月之后,账户上的值变成:
(100 + 201.252) * (1 + 0.00417) = 302.507
以此类推。

编写程序提示用户输入一个金额数(例如:100)、年利率(例如:5)以及月份数(例如:6),然后显示给定月份后账户上的钱数。

*5.30(Financial application: compound value) Suppose you save $100 each month in a savings account with annual interest rate 5%. The monthly interest rate is 0.05 / 12 = 0.00417.

After the first month, the value in the account becomes
100 * (1 + 0.00417) = 100.417
After the second month, the value in the account becomes
(100 + 100.417) * (1 + 0.00417) = 201.252
After the third month, the value in the account becomes
(100 + 201.252) * (1 + 0.00417) = 302.507
and so on.

本文标签: 复利第五章金融compoundFinancial