Question: Visual Basic 2017 Community Modify the interface to allow the user to select the term (15, 20, 25 or 30) from a list box. Make

Visual Basic 2017 Community

Modify the interface to allow the user to select the term (15, 20, 25 or 30) from a list box. Make any other modifications you deem necessary to the interface. Be sure to reset the tab order. Also be sure to select a default item in the new list box. The Calculate button should now display only the monthly payment corresponding to the selected term. Save the solution and then start and test the application. (If the principal, rate, and term are 125000, 3.0, and 30, respectively, the monthly payment is $527.01.

This is my code i am confused on where to start like either create new buttons which is my idea but i dont think that is how it should be done.

`

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load

' Fill list box with rates and select 3.0 rate.

For dblRates As Double = 2 To 7 Step 0.5

lstRates.Items.Add(dblRates.ToString("N1"))

Next dblRates

lstRates.SelectedItem = "3.0"

End Sub

Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click

' Display the monthly mortgage payment.

Dim intPrincipal As Integer

Dim dblRate As Double

Dim dblPay As Double

Integer.TryParse(txtPrincipal.Text, intPrincipal)

Double.TryParse(1StRates.SelectedItem.ToString, dblRate)

dblRate = dblRate / 100

lblPay.Text = String.Empty

For IntTerm As Integer = 15 To 30

dblPay = -Financial.Pmt(dblRate / 12, IntTerm * 12, intPrincipal)

lblPay.Text = lblPay.Text & IntTerm.ToString &

"years: " & dblPay.ToString("C2") & ControlChars.NewLine

Next IntTerm

End Sub

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!