对
错
第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.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
第3题:
以下有关数组定义的语句序列中,错误的是 ______。
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
第4题:
有如下的程序。 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
第5题:
有如下函数: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
第6题:
此题为判断题(对,错)。
第7题:
( 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 )
第8题:
定义数组语句Dim a(b) As Integer 是正确的。
A对
B错
第9题:
Dim arrInt()as Integer=New Integer(2){}
第10题:
Dim arrInt()as Integer=New Integer(2){0,1,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.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
第15题:
有如下的程序: 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
第16题:
以下程序运行后,单击命令按钮,窗体显示的结果是 ______。 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
第17题:
单击命令按钮时,下列程序代码的执行结果为______。 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
第18题:
以下将变量NewVar定义为Integer型正确的是______。
A.Integer NewVar
B.Dim NewVar Of Integer
C.Dim NewVar As Integer
D.Dim Integer NewVar
第19题:
此题为判断题(对,错)。
第20题:
Dim arrInt()as Integer=New Integer(3){0,1,2}
第21题:
在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。
第22题:
对
错
第23题:
对
错
第24题:
对
错