麻烦帮忙看看这个如何计算把。
表格中时以A,B,C,D来评分
最后根据下面的对应数字来计算平均分。然后在转换成 A,B,C,D来显示。
Dim s As String
Dim str As double = 0
Dim A As Integer = 10
Dim B As Integer = 8
Dim C As Integer = 6
Dim D As Integer = 1
For Each dr As DataRow In drs
str= str + dr("评分")
Next
STR = STR/DRS.Count
If STR < 2 AndAlso STR > 0 Then
S= "D-"
Else If STR >=2 AndAlso STR < 4 Then
S= "D"
Else If STR >=4 AndAlso STR < 5 Then
S="C-"
Else If STR >=5 AndAlso STR < 7 Then
S="C"
Else If STR >=7 AndAlso STR < 8 Then
S="B-"
Else If STR >=8 AndAlso STR < 9 Then
S="B"
Else If STR >=9 AndAlso STR <= 10 Then
S="A"
End If
msgbox(S)