Thursday, January 20, 2011

RECURSIVE ARRAY 5

'----- Program Utama -----
CALL InputVectorDariRandom(x,N)
CALL CetakVectorKeSamping(x,N,"x","Isi Vektor :")
cari = cint(InputBox("Masukkan Bilangan yang Dicari"))


'----- Koleksi Modul -----
SUB InputVectorDariKeyboard(byRef v(), byRef N)
N = cint(InputBox("Masukkan Jumlah Elemen Array"))
REDIM v(N)
FOR i=1 TO N
v(i) = cint(InputBox("Masukkan Isi Elemen ke-" & i))
NEXT
END SUB

SUB InputVectorDariRandom(byRef v(), byRef N)
N = cint(InputBox("Masukkan Jumlah Elemen Array"))
REDIM v(N)
FOR i=1 TO N
v(i) = 10 + int(rnd*90)
NEXT
END SUB

SUB CetakVector(byVal v(), byVal N, byVal nama, byVal message)
document.write "
" & message & "
"
FOR i=1 TO N
document.write nama & "(" & i & ") = " & v(i) & "
"
NEXT
END SUB

SUB CetakVectorKeSamping(byVal v(), byVal N, byVal nama, byVal message)
document.write "
" & message & "
"
FOR i=1 TO N
document.write v(i) & ", "
NEXT
document.write "
"
END SUB

No comments:

Post a Comment