如何使用固定的月份和兴趣编码Auto Loan计算? (VB)

时间:2014-04-17 13:16:52

标签: vb.net

我需要制作一个汽车贷款计算器,它只能计算84个月的2.3%利息。我从来没有制作过一个不允许用户输入这些金额的计算器,那么如何编写计算的那部分?

2 个答案:

答案 0 :(得分:0)

    Dim res As Decimal = 100 ' Current value
    Dim interest As Decimal = 1.89 / 100 ' 1.89%
    For i As Integer = 1 To 89 'Months
        Dim amr As Decimal = res * interest
        res += amr
    Next
    MsgBox(res)

答案 1 :(得分:0)

取决于您想要计算的内容..每月付款,股权,还剩下什么?

以下是计算每月贷款支付的公式

    Dim monthlyPaiement As Decimal
    Dim loanAmount As Decimal
    Dim interestRate As Decimal
    Dim loanLengthInMonth As Decimal

    loanAmount = 25000
    interestRate = 1.9 / 100
    loanLengthInMonth = 84

    interestRate /= 12 ' Divide by number of month in a year
    monthlyPaiement = loanAmount * ((1 + interestRate) ^ loanLengthInMonth) * interestRate / (((1 + interestRate) ^ loanLengthInMonth) - 1)