整存整取定期储蓄计算器 - 计算到期本息
整存整取定期储蓄计算器
本程序可以根据您输入的存入本金和存款期限,计算到期时银行应支付的本息。
利率示例
| 存期 | 年利率 | |---|---| | 1年 | 1.5% | | 2年 | 1.7% | | 3年 | 1.9% | | 5年 | 2.2% |
程序代码:
principal = float(input('请输入存入的本金数目: '))
interest_rates = {
1: 0.015, # 一年利率为1.5%
2: 0.017, # 二年利率为1.7%
3: 0.019, # 三年利率为1.9%
5: 0.022 # 五年利率为2.2%
}
for period, interest_rate in interest_rates.items():
interest = principal * interest_rate * period
total_amount = principal + interest
print(f'存{period}年后,银行应支付的本息为:{total_amount}')
程序使用说明:
- 运行上述代码。
- 输入存入的本金数目。
- 程序将根据四种存款期限依次输出对应的本息金额。
注意事项:
- 以上代码中的利率是示例数据,实际利率可能有所不同,请根据实际情况进行相应的修改。
- 本程序仅供参考,实际存款请咨询银行工作人员。
原文地址: https://www.cveoy.top/t/topic/mVF 著作权归作者所有。请勿转载和采集!