(3)
请在划线处填入合适的代码。
Dim a(0 To 210) As Single ‘数组大小满足处理要求
Dim d(1 To 30) As Single ‘依次各选手的难度分
Dim e(1 To 30) As Single ‘依次各选手的完成分
Dim f(1 To 30) As Single ‘依次各选手的最终得分
Private Sub Command1_Click()
‘本过程从数据库读取相关数据,存储在数组a中
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn ConnectionString=“provider=Microsoft.ACE.OLEDB.12.0; data source=”+“成绩.accdb”
conn.Open
Set rs.ActiveConnection=conn
‘本过程的其他语句略
End Sub
Private Sub Command2_Click()
‘依据数组a中的相关数据统计各班级平均分
Dim i As Integer, j As Integer, n As Integer, p As Integer
Dim max As Single, min As Single, sum Single
________
For i=1 To n
p=(i-1)*7+1
d(i)=(a(p)+a(p+1))/2
sum=0
max=a(p+2) : min=a(p+2)
For j=p+2 To p+6
sum=sum+a(j)
If a(j) > max Then max=a(j)
________ min=a(j)
Next j
e(i)=(sum-max-min)/3
f(i)=d(i)+e(i)
List1.AddItem Str(i)+“ ”+Str(d(i))+“ ”+Str(e(i))+“ ”+Str(f(i))
Next i
End Sub