Tuesday, October 25, 2011

Constanta and Variable

This is the first desain,if you click Constanta and then you will see numbers like the picture below
if you click variable,then the input box will appear as below 
input value what you want
And the last if you press enter or ok then the display will be as below..

Ok,now..This is the listing..:


Public x As Single
Public y As Single
Public z As Single
Sub konstanta()
x = 10
y = 15
z = x * y
Print "X dalam nilai1 : ", x
Print "Y dalam nilai1 : ", y
Print "Z dalam nilai1 : ", z
Print ""
End Sub

Sub nilai2()
Dim a As Integer
Dim b As Integer
Dim c As Integer

a = InputBox("Ketikkan Nilai1 :", "Input")
b = InputBox("Ketikkan nilai2 :", "input")
c = a * b
Print "A dalam nilai2 :", a
Print "B dalam nilai2 :", b
Print "C dalam nilai2 :", c
Print ""
End Sub
Private Sub cmdkonstanta_click()
konstanta
End Sub
Private Sub cmdvariabel_click()
nilai2
End Sub
Private Sub cmdkeluar_click()
Unload Me
End Sub



__if there are who do not understand please ask to leave a comment (jika ada yg tidak dimengerti silahkan bertanya dengan meninggalkan komentar) __
^Anzen na gakushuu^^Ganbatte^

No comments:

Post a Comment