Public Class Frmlat_17
Dim matrika(20, 20), matrikb(20, 20), barisA, kolomA, barisB, kolomB As Integer
Dim hasila_matrika, hasila_matrikb, hasil_matrix As String
'proses input matrik
Sub input_matrik()
Dim b, k As Integer
barisA = Val(Me.TxtbarisA.Text)
kolomA = Val(Me.TxtkolomA.Text)
For b = 0 To barisA - 1
For k = 0 To kolomA - 1
matrika(b, k) = InputBox("masukan nilai matrix A untuk posisi" & b + 1 & " x " & k & " : ")
Next
Next
End Sub
Sub cetak_matrika()
Dim b, k As Integer
barisA = Val(Me.TxtbarisA.Text)
kolomA = Val(Me.TxtkolomA.Text)
For b = 0 To barisA - 1
For k = 0 To kolomA - 1
hasila_matrika = hasila_matrika & matrika(b, k) & " "
Next
hasila_matrika = hasila_matrika & Chr(13)
Next
Me.LbMatrixA.Text = hasila_matrika.ToString
End Sub
Sub input_matrikb()
Dim b, k As Integer
barisB = Val(Me.Txtbarisb.Text)
kolomB = Val(Me.Txtkolomb.Text)
For b = 0 To barisB - 1
For k = 0 To kolomB - 1
matrikb(b, k) = InputBox("masukan nilai matrix B untuk posisi" & b + 1 & " x " & k & " : ")
Next
Next
End Sub
Sub cetak_matrikb()
Dim b, k As Integer
barisB = Val(Me.Txtbarisb.Text)
kolomB = Val(Me.Txtkolomb.Text)
For b = 0 To barisB - 1
For k = 0 To kolomB - 1
hasila_matrikb = hasila_matrikb & matrikb(b, k) & " "
Next
hasila_matrikb = hasila_matrikb & Chr(13)
Next
Me.LbMatrixB.Text = hasila_matrikb.ToString
End Sub
Private Sub Bproses_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Bproses.Click
Call input_matrik()
Call cetak_matrika()
Call input_matrikb()
Call cetak_matrikb()
End Sub
Private Sub TxtKolomA_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtKolomA.TextChanged
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
End Class
Komentar
Posting Komentar