Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is for Visual Studio: The credit union currently charges 6.9% annual intere

ID: 3806412 • Letter: T

Question

This is for Visual Studio:

The credit union currently charges 6.9% annual interest rate for new vehicle loans and 8.5% annual interest rate for used vehicle loans. The annual interest rate is automatically entered after user select new or used vehicle. The credit union does not finance a vehicle for less than 6 months or more than 48 months. The loan amortization table is displayed using a DataGridView with each period’s data entered as a row of the DataGridView.   You may use VB’s financial functions PMT, IPMT and PPMT to compute the payment, interest payment and principal payment. These functions are identical as Excel’s functions. Compute and display the total interest payment in a textbox at the bottom of the interest column. The Calculate button create the table; the Reset button clear all controls and the Exit button close the form (this.Close()). Test your program with these data:

Cost of Vehicle= $25,000, Downpayment = $5,000, Number of Months = 12, and is a new car.

1

$1,729.61

$115.00

$1,614.61

$18,385.39

2

$1,729.61

$105.72

$1,623.90

$16,761.49

3

$1,729.61

$96.38

$1,633.23

$15,128.26

4

$1,729.61

$86.99

$1,642.63

$13,485.63

5

$1,729.61

$77.54

$1,652.07

$11,833.56

6

$1,729.61

$68.04

$1,661.57

$10,171.99

7

$1,729.61

$58.49

$1,671.12

$8,500.86

8

$1,729.61

$48.88

$1,680.73

$6,820.13

9

$1,729.61

$39.22

$1,690.40

$5,129.73

10

$1,729.61

$29.50

$1,700.12

$3,429.62

11

$1,729.61

$19.72

$1,709.89

$1,719.72

12

$1,729.61

$9.89

$1,719.72

$0.00

Total Interest

$755.36

Requirement: Alternating the color of the table’s rows with any two colors of your choice.

1

$1,729.61

$115.00

$1,614.61

$18,385.39

2

$1,729.61

$105.72

$1,623.90

$16,761.49

3

$1,729.61

$96.38

$1,633.23

$15,128.26

4

$1,729.61

$86.99

$1,642.63

$13,485.63

5

$1,729.61

$77.54

$1,652.07

$11,833.56

6

$1,729.61

$68.04

$1,661.57

$10,171.99

7

$1,729.61

$58.49

$1,671.12

$8,500.86

8

$1,729.61

$48.88

$1,680.73

$6,820.13

9

$1,729.61

$39.22

$1,690.40

$5,129.73

10

$1,729.61

$29.50

$1,700.12

$3,429.62

11

$1,729.61

$19.72

$1,709.89

$1,719.72

12

$1,729.61

$9.89

$1,719.72

$0.00

Total Interest

$755.36

Explanation / Answer

'structure to read data into the grid
'structure to read data into the grid
Structure Row
Dim MonthNo As Int16
Dim MonthlyPymt As Double
Dim InterestPymt As Double
Dim PrincipalPymt As Double
Dim AmtOwed As Double
End Structure

Private Sub frmLoanApp_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'populate the No of months combo box
For i = 6 To 48
cmbMonths.Items.Add(i)
Next i


End Sub

Private Sub cmdExit_Click(sender As Object, e As EventArgs) Handles cmdExit.Click
'exit the app
Me.Close()
End Sub

Private Sub cmdCalculate_Click(sender As Object, e As EventArgs) Handles cmdCalculate.Click
'set interest rate depending on vehicle type
Dim IntRate As Double
If cmbType.Text = "" Then
MsgBox("Choose Vehicle Type")
Exit Sub
End If
If cmbType.Text = "New" Then
IntRate = 0.069
Else
IntRate = 0.085
End If
'Validate inputs
If txtCost.Text = "" Then
MsgBox("Enter Vehicle Cost")
Exit Sub
End If
If txtDownPayment.Text = "" Then
MsgBox("Enter Down Payment")
Exit Sub
End If

'populate the dataview grid

Dim RowList As New List(Of Row) 'create a list of Row structures
Dim NoOfPymts As Int16
NoOfPymts = CInt(cmbMonths.Text) 'no. of payments
Dim Principal As Double
Principal = CDbl(txtCost.Text) - CDbl(txtDownPayment.Text) 'principal amount of loan
Dim TotalInt As Double
TotalInt = 0

Dim MonthlyPymt As Double
Dim IntPymt As Double
Dim PPymt As Double
Dim NewRow As New Row
NewRow.AmtOwed = 20000
For i = 1 To NoOfPymts
MonthlyPymt = Pmt(IntRate / 12, NoOfPymts, Principal, 0) 'monthly payment amount
IntPymt = IPmt(IntRate / 12, i, NoOfPymts, Principal) 'monthly interst payment amount
PPymt = PPmt(IntRate / 12, i, NoOfPymts, Principal) 'monthly principal payment amount
'fill structure for populating grid
NewRow.MonthNo = i
NewRow.MonthlyPymt = MonthlyPymt
NewRow.InterestPymt = IntPymt
NewRow.PrincipalPymt = PPymt
NewRow.AmtOwed = NewRow.AmtOwed + PPymt
Principal = NewRow.AmtOwed
'add these details in the next row of rowlist
RowList.Add(NewRow)
Next i
'use RowList to finally fill the grid
For Each r As Row In RowList
DataGridView1.Rows.Add(r.MonthNo, r.MonthlyPymt * -1, r.InterestPymt * -1, r.PrincipalPymt * -1, r.AmtOwed)
Next

'fill total interest textbox
txtTotalInterest.Text = TotalInt

End Sub

Private Sub cmdReset_Click(sender As Object, e As EventArgs) Handles cmdReset.Click
txtCost.Text = ""
txtDownPayment.Text = ""
txtTotalInterest.Text = ""
cmbMonths.Text = ""
cmbType.Text = ""
DataGridView1.SelectAll()
DataGridView1.ClearSelection()
End Sub

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote