kq thi tin
Private Sub cmdthoat_Click()
Dim x As String
x = MsgBox("ban muon thoat hay khong", vbYesNo + vbQuestion + vbDefaultButton1, "thong bao")
If x = vbYes Then
End
End If
End Sub
Private Sub cmdtiep_Click()
txthoten = " "
txtcaban = " "
txtw = " "
txte = " "
txttrungbinh = " "
txtxeploai = " "
txthoten.SetFocus
End Sub
Private Sub cmdtinh_Click()
Dim nguyen As Integer
Dim le, k As Double
Dim a, b, c As Integer
a = Val(txtcaban)
b = Val(txtw)
c = Val(txte)
k = (a + 2 * b + 2 * c) / 5
txttrungbinh = k
nguyen = Int(k)
le = k - nguyen
If le < 0.25 Then
k = nguyen
End If
If le >= 0.25 And le < 0.75 Then
k = nguyen + 0.5
End If
If le >= 0.75 Then
k = nguyen + 1
End If
txttrungbinh = k
If k >= 9 And (a >= 5) And (b >= 5) And (c >= 5) Then
txtxeploai = "suat sac"
Else
If k >= 8 And (a >= 5) And (b >= 5) And (c >= 5) Then
txtxeploai = "gioi"
Else
If k >= 7 And (a >= 4) And (b >= 4) And (c >= 4) Then
txtxeploai = "kha"
Else
If k >= 5 And (a >= 3) And (b >= 3) And (c >= 3) Then
txtxeploai = "trung binh"
Else
txtxeploai = "hong"
End If
End If
End If
End If
End Sub
Bạn đang đọc truyện trên: Truyen247.Pro