房贷计算器源代码:
Private Sub Form_Click()
Dim n As Integer 'n为贷款月数
Dim x As Double, y As Double, sum As Double, k As Double, h As Double
Dim m As Long, s As Long, c As Single 'm为面积数,s为单价,c为贷款成数
m = InputBox("请输入面积数:", , 145)
n = InputBox("请输入贷款月数", , 240)
k = InputBox("请输入优惠的比例因子", , 0.85)
c = InputBox("请输入按揭成数:", , 0.7)
x = (x * k / 100) / 12 '将年利换算成月利息
sum = s * m * c
h = sum * x * ((1 + x) ^ n) / ((1 + x) ^ n - 1)
Print "还款总额为:"; Round(h * n, 2)
Print "贷款总额为:"; sum
Print "平均月供为:"; Round(h, 2)
Print "总利息额度为:"; Round(h * n - sum)
End Sub
发布评论