Kamis, 27 Maret 2014
Mencari Luas Lingkaran
Private Sub CmdHapus_Click()
CboJariJari = ""
TxtLuas = ""
LblJariJariLingkaran = "Isi Jari-Jari"
CboJariJari.SetFocus
End Sub
Private Sub CmdHitung_Click()
If CboJariJari = "" Then
MsgBox ("Isi Nilai Jari-Jari")
End If
r = CboJariJari
If r = 7 Or r = 14 Or r = 21 Or r = 28 Or r = 35 Then
p = 22 / 7
Else
If r = 1 Or r = 2 Or r = 3 Or r = 4 Or r = 5 Or r = 6 Or r = 8 Or r = 9 Or r = 10 Or r = 11 Or r = 12 Or r = 13 Or r = 15 Or r = 16 Or r = 17 Or r = 18 Or r = 19 Or r = 20 Or r = 22 Or r = 23 Or r = 24 Or r = 25 Or r = 26 Or r = 27 Or r = 29 Or r = 30 Or r = 31 Or r = 32 Or r = 33 Or r = 34 Or r = 36 Or r = 37 Or r = 38 Or r = 39 Or r = 40 Then
p = 3.14
End If
End If
Hasil = p * (r ^ 2)
TxtLuas = Hasil
End Sub
Private Sub CmdKeluar_Click()
DoCmd.Save
DoCmd.Close
End Sub
Private Sub Form_Load()
Dim i As Integer
CboJariJari = ""
TxtLuas = ""
For i = 1 To 40
CboJariJari.AddItem i
Next i
End Sub
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar