Visual Basic - Ejercicio
Visual Basic - Ejercicio
Click Dim Subtotal As Double Dim Desc As Double Dim f, i As Integer Dim St As Double Dim Ds As Double Dim iva As Double Dim Total As Double f = dgvmatriz.RowCount - 2 St = 0 Ds = 0 For i = 0 To f Subtotal = dgvmatriz(1, i).Value * dgvmatriz(2, i).Value dgvmatriz(3, i).Value = Subtotal If Subtotal >= 100 Then Desc = Subtotal * 0.1 dgvmatriz(4, i).Value = Desc Else dgvmatriz(4, i).Value = 0 End If
St = St + dgvmatriz(3, i).Value Ds = Ds + dgvmatriz(4, i).Value iva = (St - Desc) * 0.12 Total = (St - Desc) + iva Next txtdescuento.Text = Ds txtsubtotal.Text = St txtiva.Text = iva txttotal.Text = Total End Sub End Class