第5章数组测试题.docVIP

  • 440
  • 0
  • 约5.91千字
  • 约 6页
  • 2016-11-26 发布于重庆
  • 举报
第5章数组测试题

第5章数组测试题 一、选择题 1.如下数组声明语句,( )正确。 A.Dim a[3,4] As Integer B.Dim a(3,4) As Integet C.Dim a(n,n) As Integer D.Dim a(3 4) As Integer 2.要分配存放如下矩阵的数据,( )数组声明语句能实现(不能浪费空间)。 A.Dim a(9) As Integer B.Dim a(3,3) As Single C.Dim a(-1 to 1,-5 to -3) As Single D.Dim a(-3 to -1,5 to 7) As Integer 3.如下数组声明语句,则数组a包含元素的个数有( )。 Dim a(3,-2 to 2,5) A.120 B.75 C.60 D.13 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.49 B.0 C.不确定 D.程序出错 5.下列语句中(假定变量n有值),能正确声明可调数组的是( )。 A.Dim a( ) As Integer B.Dim a( ) As Integer ReDim a(n) ReDim a(n) As Integer C.Dim a( ) As Interger D.Dim a(10) As Integer ReDim a(3,4) ReDim a(n+10) ReDim Preserve a(4,4) 6.在窗体的通用声明段自定义了数据类型Students,下列( )定义方式是正确的。 A.Private Type Students B.Type Students Name As String*10 Name As String*10 Studno As Integer Studno As Integer End Type End Students C.Type Students D.Type Students Name String*10 Name As String*10 Studno Integer Studno As Integer End Type End Type 7.以下程序的输出结果是(   )。   Option Base 1 Private Sub Command1_Click()     Dim a, b(3, 3)     a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)     For i = 1 To 3      For j = 1 To 3      b(i, j) = a(i * j)      If (j = i) Then Print Tab(j * 3); Format(b(i, j), ###);     Next j      Print     Next i End Sub A.1 2 3 B.1 C.1 4 7 D.1 2 3 4 5 6 4 5 2 4 6 4 6 7 8 9 7 8 9 3 6 9 9 二、填空题 1.数组声明时下标下界

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档