Private Sub Form_Activate()
Dim barang(4), jumlah(4), Hargasatuan(4), harga(4), total
total = 0
For i = 1 To 4
barang(i) = InputBox("masukkan nama barang ")
jumlah(i) = InputBox("masukan jumlah barang")
Hargasatuan(i) = InputBox("masukan harga satuan")
harga(i) = Val(jumlah(i)) * Val(Hargasatuan(i))
total = total + Val(harga(i))
Print "nama barang ="; barang(i)
Print "jumlah barang ="; jumlah(i)
Print "hargasatuan ="; Hargasatuan(i)
Print "harga ="; harga(i)
Print
Next i
Print "total ="; total
End Sub
Dim barang(4), jumlah(4), Hargasatuan(4), harga(4), total
total = 0
For i = 1 To 4
barang(i) = InputBox("masukkan nama barang ")
jumlah(i) = InputBox("masukan jumlah barang")
Hargasatuan(i) = InputBox("masukan harga satuan")
harga(i) = Val(jumlah(i)) * Val(Hargasatuan(i))
total = total + Val(harga(i))
Print "nama barang ="; barang(i)
Print "jumlah barang ="; jumlah(i)
Print "hargasatuan ="; Hargasatuan(i)
Print "harga ="; harga(i)
Next i
Print "total ="; total
End Sub
Tidak ada komentar:
Posting Komentar