Dim arrInt()as Integer=New Integer(2){0,1,2}
第1题:
(13)单击命令按钮时,下列程度的执行结果是 Private Sub Command1_Click() Dim a As Integer,b As Integer,c As Integer a=2:b=4:c=6 Call S2(a,b) Print"a=";a;"b=";b;"c=";c; End Sub Private Sub S1(x As Integer,y As Integer) Dim c As Integer x=2*x:y=y+2:e=x+y End Sub Sub S2(x As Integer,By Val y As Integer) Dim e As Integer x=2*x:y=y+2:e=x+y End Sub A.a=4 b=6 c=6 B.a=8 b=6 c=6 a=4 b=6 c=6 a=8 b=6 c=6 C.a=4 b=6 c=6 D.a=8 b=6 c=6 a=8 b=6 c=6 a=4 b=6 c=6
第2题:
以下定义数组或给数组元素赋值的语句中,正确的是
A.Dim x%(2) x(1)="等级考试"
B.Dim x(3), y(3)As Integer x(0)=1:y=x
C.Dim x x=Array(0,1,2)
D.Dim x(3)As Integer x=Array(0,1,2)
第3题:
以下有关数组定义的语句序列中,错误的是
A.Static arrl(3) arr1(1)=100 arrl(2)="Hello" arrl(3)=123.45
B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_Click() size=InputBOX(“输入:”) ReDim arr2(size) ┄ End Sub
C.Option Base 1 Private Sub Command3_Click() Dim arr3(3)As Integer ┄ End Sub
D.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer ┄ End Sub
第4题:
以下有关数组定义的语句序列中,错误的是 ______。
A.Static arr1(3) arr1(1)=100 arr1(2)="Hello" arr1(3)=12345
B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_Click() size=Input Box("输入:") ReDimarr2(size) ... End Sub
C.Option Base 1 Private Sub Command3_Click() Dim arr3(3)As Integer ... End Sub
D.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer ... End Sub
第5题:
有如下的程序。 Private Sub Commandl_Click( ) Dim k As Integer, m As Integer Dim P As Integer k=4: m=1 P=Fun(k, m) : Print P; P = Fun ( k, m) : Print P End Sub Private Function Fun( a As Integer, b As Integer) Static m As Integer, i As Integer m=5:i=2 i=i+m+1 m=i + a + b Fun=m\2 End Function 单击命令按钮后,输出结果为
A.2 2
B.4 4
C.5 5
D.6
第6题:
有如下函数:Private Function firstfunc(x As Integer, y As Integer) As Integer Dim n As Integer Do While n <= 4 x=x +y n=-+1 Loop firstfunc = x End Function调用该函数的事件过程如下:Private Sub Command1_lick() Dim x As Integer Dim y As Integer Dim n As Integer Dim z As Integer x=1 y=1 For n = 1 To 3 z = firstfunc(x, y) Next n Print z End Sub该事件过程的执行结果是 ______。
A.1
B.3
C.16
D.9
第7题:
阅读下面的程序; Function Func(x As Integer,y As Integer)As Integer Dim n As Integer Do While n < = 4 x=x + y n = n + 1 Loop Func=x End Function Private Sub Command1_Click() Dim x As Integet, y As Integer Dim n As Integer,z As Integer x=1 y=1 For n = 1 To 6 z=Func(x,y) Next n Print z End Sub 程序运行后,单击命令按钮,输出的结果为.
A.16
B.21
C.26
D.31
第8题:
下列程序段的执行结果为______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 T0 3 For j=0 To 3 x=x+m(i, j) Next Next Print x
A.3
B.4
C.5
D.6
第9题:
( 21 )下面正确使用动态数组的是
A )
Dim arr () As Integer
…
ReDim arr ( 3 , 5 )
B )
Dim arr () As Integer
…
ReDim arr ( 50 ) As String
C )
Dim arr ()
…
ReDim arr ( 50 ) As Integer
D )
Dim arr ( 50 ) As Integer
…
ReDim arr ( 20 )
第10题:
Dim arrInt()as Integer=New Integer(2){}
第11题:
对
错
第12题:
对
错
第13题:
下面正确使用动态数组的是( )。
A.Dim arr( )As Integer … ReDim arr(3,5)
B.Dim arr( )As Integer … ReDim arr(50)As String
C.Dim arr( ) … RcDim arr(50)As Integer
D.Dim arr(50)AS Integer … ReDim arr(20)
第14题:
执行下列程序后,变量a的值为 ( ) Dim i As Integer Dim a As Integer a=0 For i=l To 100 Step 2 a=a+l Next i
A.1
B.10
C.50
D.100
第15题:
以下有关数组定义的语句序列中,错误的是 ______。
A.Static arrl(3) arrl(1)=100 arrl(2)="Hello" arrl(3)123.45
B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_click() size=InputBox("输入:") ReDimarr2(size) End Sub
C.Option Base1 Private Sub Command3_click() Dim arr3(3)As Integer End Sub
D.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer End Sub
第16题:
有如下的程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim P As Integer k=4:m=1 P=Fun(k,m):Print P; P=Fun(k,m):Print P End Sub Private Function Fun(a As Integer,b As Integer) Static m As Integer,i As Integer in=5:i=2 i=i+m+1 m=i+a+b Fun=m\2 End Function 单击命令按钮后,输出结果为
A.2 2
B.4 4
C.5 5
D.6 6
第17题:
以下程序运行后,单击命令按钮,窗体显示的结果是 ______。 Private Function p1(x As Integer,y As Integel,z As Integer) p1=2*x+y+3*z End Function Private Function p2(x As Integer,y As Integer,z As Integer) p2=p1(2,y,x)+x End Function Private SubCommandl_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2:b=3:c=4 Print p2(c,b,A)
End Sub
A.19
B.21
C.22
D.23
第18题:
单击命令按钮时,下列程序代码的执行结果为______。 Private Function FirProc (x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Function Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Function Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim C As Integer a=2 b = 3 c = 4 Print SecProc(c,b,A) End Sub
A. 21
B.19
C.17
D.34
第19题:
以下将变量NewVar定义为Integer型正确的是______。
A.Integer NewVar
B.Dim NewVar Of Integer
C.Dim NewVar As Integer
D.Dim Integer NewVar
第20题:
以下有关数组定义的语句序列中,错误的是( )。
A.Static arr1(3) arr1(1)=100 arr1(2)="Hello" arr1(3)=123.45
B.Dim arr2() AsInteger Dim size As Integer Private Sub Command2_Click () size=InputBox("输入:") ReDim arr2(size) …… EndSub
C.Option Base 1 Private Sub Command3 Click() Dim art3(3) As Integer …… End Sub
D.Dim n As Integer Private Sub Command4 Cliok() Dim arr4(n)As Integer …… End Sub
第21题:
Dim arrInt()as Integer=New Integer(3){0,1,2}
第22题:
在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。
第23题:
对
错