主题:紧急!!VB求解,10分钟内需要
期末VB上机考试!紧急求援!
程序功能:
3个学生的5门课成绩存放在3行5列的score数组中,求成绩优秀的学生的平均成绩,在文本框text1中显示运行结果。符合下列条件t1,t2,t3之一的为优秀成绩
Private Sub Form_Click()
Dim Score(1 To 3, 1 To 5) As Integer, n1, n2, n3, n4, n5, total%, num%
mark = Array(98, 95, 100, 92, 96, 94, 86, 95, 89, 75, 93, 95, 97, 89, 96)
k = 0
For n = 1 To 3
For m = 1 To 5
Score(n, m) = mark(k)
k = k + 1
Next m, n
For n = 1 To 3
n1 = Score(n, 1): n2 = Score(n, 2): n3 = Score(n, 3)
n4 = Score(n, 4): n5 = Score(n, 5)
s = n1 + n2 + n3 + n4 + n5
t1 = s > 450
t2 = n1 >= 88 And n2 >= 88 And n3 >= 88 And n4 >= 88 And n5 >= 88
t3 = n1 >= 95 And n2 >= 95 And n3 >= 95 And n4 >= 80 And n5 >= 80
t = ___________________________
If _____________ Then total = total + s ______________________
Next
Text1 = total / (num * 5)
End Sub
程序功能:
3个学生的5门课成绩存放在3行5列的score数组中,求成绩优秀的学生的平均成绩,在文本框text1中显示运行结果。符合下列条件t1,t2,t3之一的为优秀成绩
Private Sub Form_Click()
Dim Score(1 To 3, 1 To 5) As Integer, n1, n2, n3, n4, n5, total%, num%
mark = Array(98, 95, 100, 92, 96, 94, 86, 95, 89, 75, 93, 95, 97, 89, 96)
k = 0
For n = 1 To 3
For m = 1 To 5
Score(n, m) = mark(k)
k = k + 1
Next m, n
For n = 1 To 3
n1 = Score(n, 1): n2 = Score(n, 2): n3 = Score(n, 3)
n4 = Score(n, 4): n5 = Score(n, 5)
s = n1 + n2 + n3 + n4 + n5
t1 = s > 450
t2 = n1 >= 88 And n2 >= 88 And n3 >= 88 And n4 >= 88 And n5 >= 88
t3 = n1 >= 95 And n2 >= 95 And n3 >= 95 And n4 >= 80 And n5 >= 80
t = ___________________________
If _____________ Then total = total + s ______________________
Next
Text1 = total / (num * 5)
End Sub