1 等额本金

标题:等额本金

    小明从银行贷款3万元。约定分24个月,以等额本金方式还款。

    这种还款方式就是把贷款额度等分到24个月。每个月除了要还固定的本金外,还要还贷款余额在一个月

中产生的利息。

    假设月利率是:0.005,即:千分之五。那么,

    第一个月,小明要还本金 1250, 还要还利息:30000 * 0.005,总计 1400
第二个月,本金仍然要还 1250, 但利息为:(30000-1250) * 0.005 总计 1393.75 请问:小明在第15个月,应该还款多少(本金和利息的总和)? 请把答案金额四舍五入后,保留两位小数。注意:32.5,一定要写为:32.50 通过浏览器提交答案,这是一个含有小数点和两位小数的浮点数字。不要写多余内容(例如:多写了“元 ”或添加说明文字) 1312.50
public class Main {

    public void printResult() {
double money = 30000;
for(int i = 1;i <= 14;i++) {
money = money * (1 + 0.005) - 1250 - money * 0.005;
}
double result = 1250 + money * 0.005;
System.out.println(result);
return;
} public static void main(String[] args) {
Main test = new Main();
test.printResult();
} }

最新文章

  1. JS常用各种正则表达式
  2. poj 3083 Children of the Candy Corn(DFS+BFS)
  3. mono 判断系统的网络是否可用
  4. 8年,属于 HTML 5 春天的到来悄悄!
  5. Swift中自定义打印方法
  6. 谈JS中的作用域链与原型链(1)
  7. Learning ROS for Robotics Programming Second Edition学习笔记(九) indigo Gazebo rviz slam navigation
  8. LwIP Application Developers Manual2---Protocols概览
  9. web 前端知识体系 网站资源分析
  10. 字符常量 java
  11. ubuntu16.04 彻底卸载MySQL
  12. set&lt;pair&lt;int,int&gt; &gt;的用法
  13. Linux 搭建FTP
  14. Codeforces Good Bye 2018
  15. 以整数元素构成的list中的数字组成最小整数
  16. tomcat部署jenkins启动报错:insufficient free space available after evicting expired cache entries-consider increasing the maximum size of the cache.
  17. Word中调整编号和文字的间距
  18. 引进js文件运行在浏览器上调试报文件找不到
  19. luogu 1355 神秘大三角 判断点和三角形的位置关系 面积法 叉积法
  20. Log4J的配置与使用详解

热门文章

  1. ZSTU OJ 4272 最佳淘汰算法
  2. SCU - 4439 Vertex Cover (图的最小点覆盖集)
  3. CSS排版常用值指南
  4. Linux基础系列-Day6
  5. C++中的error C2662,const的this指针问题
  6. PMP的六大管理学定律
  7. Codeforces Round #448(Div.2) Editorial ABC
  8. (疯狂java)第四课(上)
  9. json,xml,html三种数据格式
  10. Spring中与Spring相关的注解