打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
java 等额本息计算方式

投资理财,等额本息计算方式

以下按照10000元,以年利率15.5%,投资期限为6个月,以等额本息方式偿还来计算
/** * 等额本息计算 */public class PrincipalAndInterestEquals { public static void main(String[] args) { double invest = 10000; //贷款本金 double yearRate = 0.155; //年利率 double monthRate = yearRate/12; //月利率// int year = 15; //还款年数 int month = 6; //还款月数 System.out.println('本金-->'+invest+' 年利率--->'+yearRate*100+'%'+' 期限--->'+month+'个月'); System.out.println('--------------------------------------------'); // 每月本息金额 = (本金×月利率×(1+月利率)^还款月数)÷ ((1+月利率)^还款月数-1)) double monthIncome = (invest* monthRate * Math.pow(1+monthRate,month))/(Math.pow(1+monthRate,month)-1); System.out.println('每月本息金额 : ' + monthIncome); System.out.println('---------------------------------------------------'); // 每月本金 = 本金×月利率×(1+月利率)^(还款月序号-1)÷((1+月利率)^还款月数-1)) double monthCapital = 0; for(int i=1;i<>1;i++){ monthCapital = (invest* monthRate * (Math.pow((1+monthRate),i-1)))/(Math.pow(1+monthRate,month)-1); System.out.println('第' + i + '月本金: ' + monthCapital); } System.out.println('---------------------------------------------------'); // 每月利息 = 剩余本金 x 贷款月利率 double monthInterest = 0; double capital = invest; double tmpCapital = 0; double totalInterest = 0; for(int i=1;i<>1;i++){ capital = capital - tmpCapital; monthInterest = capital * monthRate; tmpCapital = (invest* monthRate * (Math.pow((1+monthRate),i-1)))/(Math.pow(1+monthRate,month)-1); System.out.println('第' + i + '月利息: ' + monthInterest); totalInterest = totalInterest + monthInterest; } System.out.println('-------------------------------------------------'); System.out.println('利息:--->'+totalInterest); System.out.println('-------------------------------------------------'); System.out.println('年利率:--->'+totalInterest/month*12/invest*100+'%'); } /** * 获取每月本息金额 * 计算方式 * 每月本息金额 = (本金×月利率×(1+月利率)^还款月数)÷ ((1+月利率)^还款月数-1)) * @param invest 本金 * @param yearRate 年利率 * @param month 还款月 * @return 每月本息金额 */ public double getMonthIncome(double invest, double yearRate,int month){ double monthRate = yearRate/12; //月利率 double monthIncome = (invest* monthRate * Math.pow(1+monthRate,month))/(Math.pow(1+monthRate,month)-1); return monthIncome; }}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
本金-->10000.0 年利率--->15.5% 期限--->6个月--------------------------------------------每月本息金额 : 1742.8196429537836---------------------------------------------------第1月本金: 1613.6529762871169第2月本金: 1634.495993897492第3月本金: 1655.6082338186682第4月本金: 1676.9931735054925第5月本金: 1698.6543353299387第6月本金: 1720.5952871612835---------------------------------------------------第1月利息: 129.16666666666666第2月利息: 108.3236490562914第3月利息: 87.21140913511546第4月利息: 65.82646944829101第5月利息: 44.16530762384506第6月利息: 22.224355792500013-------------------------------------------------利息:--->456.91785772270964-------------------------------------------------年利率:--->9.138357154454193%
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

所以当我们以15.5%的年利来进行等额本息理财的时候,其实换算之后,年利率只相当于百分之9%

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
住房贷款还款本息明细计算
一文教你计算真实的年化利率
银行贷款的还款法及其计算方法
等额本息还款法 和 等额本金还款法
买房的注意!等额本金和等额本息,一字之差利息差很大
计算每月还款额公式
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服