2012年计算机二级VB考前预测选择题及答案(5)
1.下面数组声明语句,_________正确。 A)Dim a[2,4] As Integer B)Dim a(2,4)As Integer C)Dim a(n,n)As Integer D)Dim a(2 4)As Integer 2.假定建立了一个名为Command1的命令按钮数组,则以下说法中错误的是________。 A)数组中每个命令按钮的名称(名称属性)均为Command1 B)数组中每个命令按钮的标题(Caption属性)都一样 C)数组中所有命令按钮可以使用同一个事件过程 D)用名称Command1(下标)可以访问数组中的每个命令按钮 3.下面数组声明语句中,数组包含元素个数为 ________。 Dim a(-2 to 2,5) A)120 B) 30 C )60 D)20 4.下面程序的输出结果是 ________。 Dim a a = Array(1,2,3,4,5,6,7) For i = Lbound(a)to Ubound(a) a(i)= a(i)* a(i) Next i Print a(i) A)36 B)程序出错 C)49 D)不确定 5.下面程序的输出结果是 ________。 Option Base 1 Private Sub Command1_Click() Dim a%(3, 3) For i = 1 To 3 For j = 1 To 3 If j > 1 And i > 1 Then a(i, j)= a(a(i - 1, j - 1), a(i, j - 1))+ 1 Else a(i, j)= i * j End If Print a(i, j); ""; Next j Next i End Sub A) 1 2 3 2 3 1 3 2 3 B)1 2 3 1 2 3 1 2 3 C )1 2 3 2 4 6 3 6 9 D)1 2 3 2 2 2 3 3 3 首页 1 2 尾页 相关资料 |