Source Code
Private Sub Cmdhitung_Click()
Dim i, n, jum, jumkuadrat, simpanganbaku, rata As Double
For i = 0 To List1.ListCount - 1
jum = jum + Val(List1.List(i))
jumkuadrat = jumkuadrat + (List1.List(i)) ^ 2
n = n + 1
Next i
rata = jum / n
simpanganbaku = Sqr(((n * jumkuadrat) - (jum ^ 2)) / (n * (n - 1)))
lbljumlah.Caption = jum
lblrata.Caption = rata
lblsb.Caption = simpanganbaku
End Sub
Private Sub cmdkeluar_Click()
End
End Sub
Private Sub cmdulang_Click()
List1.SetFocus
List1.Clear
lbljumlah.Caption = ""
lblrata.Caption = ""
lblsb.Caption = ""
End Sub
Private Sub Txt1_keypress(keyascii As Integer)
Dim a As Integer
a = Val(Txt1.Text)
If keyascii = 13 Then
List1.AddItem a
Txt1.Text = ""
End If
End Sub
Silahkan download programnya disini
0 komentar:
Posting Komentar