1、第三阶段练习题( 参考答案)一、单项选择题题号 1 2 3 4 5 6 7 8 9 10答案 D B D C D D B A A C题号 11 12 13 14 15 16 17 18 19 20答案 B D C D C A C C B D二、填空题1名字2类型3下标4Dim a(0 to 5, -3 to 6) as Integer506通用声明7Option Base8可调数组9可变类型数组10同一个事件过程11Index12IsArray13局部变量14Eed Sub15Exit Sub16Rnd17Static18窗体模块19标准模块20类模块21函数过程名22整个应用程序23作用域2
2、4传值参数25传址参数26该窗体模块或标准模块三、程序填空题1 Int(Rnd * 100 + 1) String(a(i) 2, “*“); “a(“; i; “)=“; a(i) 2ReDim a(n, n) y 1 To (n + 1) 2 a(j, k) = i Print3 a(7) a(j + 1) = a(j) a(1) = t4 Preserve a(n + 1) a(i + 1) = a(i) a(i + 1) = m5 m(1) * 3 n = 3 6 m 0 m To n n = n - 1 m = m 1 b()7 common_divisor = x common_d
3、ivisor(a, b)8 Dem = Convert(St) Mid(S, i, 1) Asc(SubC) - Asc(“A“) + 10 Convert = p 四、程序阅读题149 21 2 32 3 13 2 3 3 1 2 34 694 2 32 23 33 23 33 34 43 45 2 346 277 a=4 b=6 c=6a=8 b=6 c=68 3 5 7 4 5五、编程题1Private Sub Command1_Click()RandomizeDim a(100) As Integern = 0For i = 1 To 100a(i) = Int(Rnd * 100)I
4、f a(i) b Thenmax1 = aElsemax1 = bEnd IfIf max1 c Then min1 = cmin = min1End FunctionPrivate Sub Command1_Click()Clsn = Val(InputBox(“请输入 3 或 5 或 7“)ReDim a(n) As IntegerFor i = 1 To na(i) = Val(InputBox(“请输入第“ NextPrintSelect Case nCase 3max1 = max(a(1), a(2), a(3)Print “max=“; max1min1 = min(a(1),
5、a(2), a(3)Print “min=“; min1Case 5max1 = max(max(a(1), a(2), a(3), a(4), a(5)Print “max=“; max1min1 = min(min(a(1), a(2), a(3), a(4), a(5)Print “min=“; min1Case 7max1 = max(max(max(a(1), a(2), a(3), a(4), a(5), a(6), a(7)Print “max=“; max1min1 = min(min(min(a(1), a(2), a(3), a(4), a(5), a(6), a(7)Print “min=“; min1End SelectEnd Sub7Public Function aaa(a As Integer)If a Mod 2 = 0 Thenaaa = “True“Elseaaa = “False“End IfEnd FunctionPrivate Sub Command1_Click()Print aaa(Val(Text1)End Sub