2009年9月二级VB考试模拟练习题6(附答案及解析)
来源:优易学  2011-8-28 16:09:27   【优易学:中国教育考试门户网】   资料下载   IT书店

 

(31) 不能脱离控件(包括客体) 而独立存在的过程是
  A) 事件过程
  B) 通用过程
  C) Sub过程
  D)函数过程
  正确答案: A
  (32) Sub过程与Function过程最根本的区别是
  A) Sub过程可以用Call语句直接使用过程名调用,而Function过程不可以
  B) Function过程可以有形参,Sub过程不可以
  C) Sub过程不能返回值,而Function过程能返回值
  D)两种过程参数的传递方式不同
  正确答案: C
  (33) 单击命令按钮时,下列程序的执行结果为
  Private Sub Command1_Click()
  Dim x As Integer, y As Integer
  x=12:y=32
  Call Proc(x,y)
  Print x; y
  End Sub
  Public Sub Proc(n As Integer, ByVal m As Integer)
  n=n Mod 10
  m=m Mod 10
  End Sub
  A) 1232
  B) 232
  C) 23
  D)123
  正确答案: B
  (34) 单击命令按钮时,下列程序的执行结果是
  Private Sub Command1_Click()
  Dim a As Integer, b As Integer, c As Integer
  a=3
  b=4
  c=5
  Print SecProc(c, b, A)
  End Sub
  Function FirProc(x As Integer, y As Integer, z As Integer)
  FirProc=2x+y+3z
  End Function
  Function SecProc(x As Integer, y As Integer, z As Integer)
  SecProc=FirProc(z, x, y) +x
  End Function
  A) 20
  B) 22
  C) 28
  D)30
  正确答案: C
  (35) 下列程序的执行结果为
  Private Sub Command1_Click()
  Dim FirStr As String
  FirSt="abcdef"
  Print Pat(FirStr)
  End Sub
  Private Function Pat(xStr As String) As String
  Dim tempStr As String, strLen As Integer
  tempStr=""
  strLen=Len(xStr)
  i=1
  Do While i<=Len(xStr) -3
  tempStr=tempStr+Mid(xStr, i, 1) +Mid(xStr, strLen -i+1, 1)
  i=i+1
  Loop
  Pat=tempStr
  End Function
  A) abcdef
  B) afbecd
  C) fedcba
  D)defabc
  正确答案: B

上一页  [1] [2] [3] [4] [5] 下一页

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训