自流平施工工艺流程-景观设计平面图手绘

C#房贷计算器(等本降息)
2023年4月23日发(作者:中央空调符号图案大全)

C#房贷计算器(等本降息)

算法(等本降息)

房贷⼀般可以选择等本降息和等额本息还款⽅式

利率调整⼀般有利率变动的次⽉1⽇起和次年起

要是你选的是等本降息,且利率⼀年调整⼀次:

每⽉的还款利息=尚⽋银⾏的借款本⾦

年利率/12

每⽉的本⾦是固定的=总⽋款/总还款⽉份数

⽐如你说的10万贷款

每⽉还本⾦=100 000/60=1 666.67元

第⼀个⽉的利息=100 000

5.05%/12=420.83

第⼆个⽉的利息=(100 000-1 666.67)*5.05%/12=413.82

等本降息 等于 每⽉还的本⾦固定不变 利息逐渐降低

实验体会

房贷还款计算器的难点在其算法。要正确理解每⽉还款的计算公式,然后再⽤程序实现。多次计算时,要注意每次输出计算结果之前,清空

。另外,需要解决的问题是:当年份过⼤时,输出⾏数超出屏幕显⽰范围,会导致产⽣显⽰不全的问题。

修改之后:将textbox1的multiline属性改为true,scroolbars属性改为both即可显⽰滚动条

窗体

代码

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace 实验⼆_4房贷计算

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

double total;

double year;

double rate;

//

输⼊

total = double.Parse(textBox1.Text);

year = double.Parse(textBox2.Text);

rate = double.Parse(textBox3.Text) / 100;

//

计算

double[] moneyEachMonth;

double totalMonth = year * 12;//

总⽉份

double minMoneyEachMonth = total / totalMonth;//

每⽉本⾦

moneyEachMonth = new double[(int)totalMonth];//

每⽉还款数组

int i;

for (i = 0; i < totalMonth; i++)

{

moneyEachMonth[i] = ((total - i * minMoneyEachMonth) * rate / 12) + minMoneyEachMonth;//

等本降息等于每⽉还的本⾦固定不变利息逐渐降低

}

textBox4.Text = "";//

先清空

for (i = 0; i < totalMonth; i++)

{

textBox4.Text += "" + (i + 1) + "⽉:" + moneyEachMonth[i] + "rn";

}

}

private void label8_Click(object sender, EventArgs e)

{

}

private void Form1_Load(object sender, EventArgs e)

{

}

}

}

40平办公室布置效果图-镀铝锌板是什么材质

C#房贷计算器(等本降息)

更多推荐

房贷利息计算器