Option Base 1
Private Sub Command1_Click()
Dim city As Variant
city = ____ ____________ ("北京", "天津", "上海", "重庆")
For i = To UBound(city)
Combo1.AddItem ____ ____________
Next
End Sub
3.比赛评分程序。在窗体上建立一个文本框、一个标签框和三个命令按钮,单击“输入评分”命令按钮,分别输入评委人数及各个评委的评分,单击“计算得分”命令按钮则计算并将最后得分显示在Text1文本框中(去掉一个最高分和一个最低分后的平均分即为最后得分),要求输入评分之前,“计算得分”按钮失效(变灰),如图5-28所示。以下是实现上述功能的程序,请填空。
图5-28
Option Base 1
Dim a() As Single, n As Integer
Private Sub Form_Load()
Command2.Enabled = ____ _____________
End Sub
Private Sub Command1_Click()
n = InputBox("请输入评委人数:")
_____ ____________ _____
For i = 1 To n
____ _____________ = InputBox("请输入评委评分:")
Next i
Command2.Enabled = True
End Sub
Private Sub Command2_Click()
Dim sum As Single, aver As Single
Dim max As Single, min As Single
max = a(1): min = a(1): sum = a(1)
For i = _____ ________________
sum =____ ____________ ______
If max < a(i) Then max=a(i)
If min > a(i) Then min=a(i)
Next i
aver = (sum - max - min) / (n - 2)
Text1.Text = Str(aver)
End Sub
Private Sub Command3_Click()
End
End Sub
附:模拟试卷参考答案
一、选择题
1. C 2.B 3.A 4.C 5.D 6.B 7.D 8.B 9.C 10.B
11.D 12.C 13.C 14.D 15.B 16.A 17.B 18.C 19.B 20.D
21.C 22.C 23.A 24.D 25.C 26.D 27.B 28.B 29.B 30.A
31.D 32.B 33.C 34.C 35.C 36.C 37.D 38.B 39.B 40.C
二、填空题
1.剪切 2.目标程序 3.教育 4.白色 5.分辨率
6.右击 7.ROM 8.软件 9.-51 10.AutoSize
11.Enabled 12.宽带传输 13.HTTP 14.物理层 15.全局模式
三、判断题
1. ╳ 2.╳ 3.√ 4.╳ 5√ 6.╳ 7.╳ 8.╳ 9.╳ 10. √
11. ╳ 12. √ 13.╳ 14. √ 15.╳
四、程序阅读题
(1) 111222 (2) 21 (3) 15 (4) 45 (5) 9
(6) 50 (7) 72 (8) 21 (9) A1B
五、程序填空
(1) 9 (2) a mod 3=0 (3) Array (4) 1 (5) city(i) (6) False (7) Redim a(n) (8) a(i) (9) 2 to n (10) sum+a(i)