Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Command1_Click()
i = Val(Text1.Text)
If i < 1 Then
MsgBox "Usia Minimal Adalah 1", vbOKOnly, "INPUT SALAH"
Else
If i > 150 Then
MsgBox "Usia Terlalu Tua", vbOKOnly, "INPUT SALAH"
Else
If Not i = Int(i) Then
MsgBox "Usia Harus Merupakan Bilangan Bulat", vbOKOnly, "INPUT SALAH"
Else
If Combo1.Text = "Laki-Laki" Then
If i >= 1 And i < 7 Then
w = i
x = 55.6
r = 10.3
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 7 And i < 16 Then
w = i - 6
x = 114.75
r = 5.27
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 16 And i < 20 Then
w = i - 15
x = 164
r = 1.1
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 20 And i < 23 Then
w = i - 19
x = 168.4
r = 0.3
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 23 And i < 26 Then
w = i - 22
x = 169.3
r = 0.1
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 26 And i < 40 Then
w = i - 25
x = 169.5
r = 0
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 40 And i < 65 Then
w = i - 39
x = 169.5
r = -0.15
For j = 0 To w Step 1
dx = j * r
Next j
Else
w = i - 65
x = 165.75
r = -0.01
For j = 0 To w Step 1
dx = j * r
Next j
End If
End If
End If
End If
End If
End If
End If
Else
If i >= 1 And i < 6 Then
w = i
x = 55.6
r = 9.9
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 6 And i < 13 Then
w = i - 5
x = 110
r = 5.33
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 13 And i < 19 Then
w = i - 12
x = 148
r = 1.1
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 19 And i < 21 Then
w = i - 18
x = 156.5
r = 0.2
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 21 And i < 23 Then
w = i - 22
x = 157
r = 0.1
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 23 And i < 35 Then
w = i - 22
x = 157.3
r = 0
For j = 0 To w Step 1
dx = j * r
Next j
Else
If i >= 35 And i < 60 Then
w = i - 34
x = 157.3
r = -0.09
For j = 0 To w Step 1
dx = j * r
Next j
Else
w = i - 60
x = 155.05
r = -0.01
For j = 0 To w Step 1
dx = j * r
Next j
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
t = x + dx
Label1.Caption = t
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Form_Load()
Command1.Enabled = False
Combo1.AddItem ("Laki-Laki")
Combo1.AddItem ("Perempuan")
End Sub
Private Sub Text1_Change()
If Combo1.Text = "jenis kelamin" Then
MsgBox "Pilih Jenis Kelamin Dahulu", vbOKOnly, "Perhatian"
Else
Command1.Enabled = True
End If
End Sub
Tidak ada komentar:
Posting Komentar