0% found this document useful (0 votes)
3 views3 pages

Visual Basic Array Operations Guide

The document declares arrays a, b, and c with 4 rows and 4 columns of single data type. It declares variables baris, kolom, kal and performs operations like adding values to arrays a and b based on user input for baris and kolom. It loops through arrays a and b to add values and display the sum in list boxes. It also finds the maximum value in an array nilai and displays it.

Uploaded by

Roi Milyardi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Visual Basic Array Operations Guide

The document declares arrays a, b, and c with 4 rows and 4 columns of single data type. It declares variables baris, kolom, kal and performs operations like adding values to arrays a and b based on user input for baris and kolom. It loops through arrays a and b to add values and display the sum in list boxes. It also finds the maximum value in an array nilai and displays it.

Uploaded by

Roi Milyardi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Dim a(4, 4) As Single

Next j

Dim b(4, 4) As Single

[Link] kal

Dim c(4, 4) As Single

Next i

Private Sub Command1_Click()

End Sub

baris = Val(Text1)

Private Sub Command7_Click()

kolom = Val(Text2)

c(i, j) = a(i, j) + b(i, j)

a(baris, kolom) = Val(Text3)

For i = 1 To 4

End Sub

kal = ""

Private Sub Command2_Click()

For j = 1 To 4

[Link]

kal = kal & a(i, j) + b(i, j) & ""

For i = 1 To 4

Next j

kal = ""

[Link] kal

For j = 1 To 4

Next i

kal = kal & a(i, j) & " "

End Sub

Next j
[Link] kal
Next i
End Sub
Private Sub Command3_Click()
baris = Val(Text4)
kolom = Val(Text5)
b(baris, kolom) = Val(Text6)
End Sub
Private Sub Command4_Click()
[Link]
For i = 1 To 4
kal = ""
For j = 1 To 4
kal = kal & b(i, j) & " "

Dim nilai(100) As Single


Dim n As Integer
Private Sub Command1_Click()
n=n+1

nama(n) = Trim(Text1)
nilai(n) = Val(Text2)
[Link] nama(n) & " : nilai = " &
nilai(n)
End Sub
Private Sub Command2_Click()
nilaiMaks = nilai(1)
For i = 2 To n
If nilai(i) > nilaiMaks Then nilaiMaks =
nilai(i)
Next
[Link] ""
[Link] "Nilai Terbaik Oleh yang
nilainya : " & nilaiMaks
End Sub
Private Sub Command4_Click()
End
End Sub

Private Sub Command1_Click()


n = Val(Text1)

Private Sub Form_Load()


n=0
[Link]
End Sub

[Link]
For i = 1 To n
bil = (0.5 * i ^ 2) - (0.5 * i) + 1
[Link] bil
Next i

End Sub

Private Sub Command2_Click()


[Link] = ""
[Link]

End Sub

Private Sub Command3_Click()


End
End Sub

You might also like