Question: Loan Calculator. create an application that displays a monthly payment on a loan. The application should also display the amount applied to the loan's principal

Loan Calculator. create an application that displays a monthly payment on a loan. The application should also display the amount applied to the loan's principal each month and the amount that represent interest.The method's syntax is Financial.PPmt(Rate, Per, NPer, PV). The method returns the calculated value as a Double number. Where I am going wrong?

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load ' fills the combo box with values

For term As Integer = 1 To 30 termComboBox.Items.Add(term.ToString) Next term termComboBox.SelectedItem = "30"

For annualrate As Double = 0.02 To 0.1 Step 0.01 rateComboBox.Items.Add(annualrate.ToString) Next annualrate

End Sub

Private Sub DisplayButton_Click(sender As Object, e As EventArgs) Handles displayButton.Click ' display the monthly payment Dim monthlypayment As Double Dim principal As Double Dim rate As Double Dim term As Integer Dim loan As Double Dim interestrate As Double

Double.TryParse(rateComboBox.Text, rate) Double.TryParse(principalTextBox.Text, principal) ListBox.Items.Clear() ListBox.Items.Add("Principal Interest") term = Convert.ToInt32(termComboBox.Text)

For period As Double = 0.02 To 0.1 Step 0.01 monthlypayment = -Financial.PPmt(rate / 12, period, term, loan) rate = loan - principal ListBox.Items.Add(" " & principal.ToString("C2") & " " & " " & rate.ToString("C2")) Next period End Sub

Private Sub PrincipalTextBox_TextChanged(sender As Object, e As EventArgs) Handles principalTextBox.TextChanged

End Sub

Private Sub ExitButton_Click(sender As Object, e As EventArgs) Handles exitButton.Click Me.Close() End Sub End Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!