2007年9月计算机等级二级VB考前密卷三及答案

出处:Examlink 作者:刀断水 日期:2007年08月30日 13时54分

(29) 下列程序段的执行结果为
  a=6
  For k=1 To 0
   a=a + k
  Next k
  Print k; a
  A) -1 6      
  B) -1 16
  C) 1  6      
  D) 11 21
(30) 下列程序段的执行结果为
  a=1
  b=1
   For I=1 To 3
   f=a + b
   a=b
   b=f
   Print f;
 Next I
  A) 2 3 6      
  B) 2 3 5
  C) 2 3 4      
  D) 2 2 8
(31) 下列过程定义语句中,形参个数为不确定数量的过程是
  A) Private Sub Pro3(x As Double,y As Single)
  B) Private Sub Pro3(Arr(3),Option x,Option y)
  C) Private Sub Pro3(ByRef x,ByVal y,Arr( ))
  D) Private Sub Pro3(ParamArray Arr( ))
(32) 单击命令按钮时,下列程序的执行结果为
 Private Sub Command1_Click()
   Dim x As Integer, y As Integer
   x=12: y=32
   Call PCS(x, y)
   Print x; y
 End Sub
 Public Sub PCS(ByVal n As Integer, ByVal m As Integer)
   n=n Mod 10
   m=m Mod 10
 End Sub
  A) 12 32     
  B) 2 32
  C) 2 3      
  D) 12 3
(33) 单击一次命令按钮后,下列程序的执行结果是
 Private Sub Command1_Click()
   s=P(1) + P(2) + P(3) + P(4)
   Print s
 End Sub
 Public Function P(N As Integer)
   Static Sum
   For i=1 To N
    Sum=Sum + i
   Next i
   P=Sum
End Function
  A) 15      
  B) 25
  C) 35      
  D) 45
(34) 下列程序的执行结果为
 Private Sub Command1_Click()
   Dim s1 As String, s2 As String
   s1="abcdef"
   Call Invert(s1, s2)
   Print s2
 End Sub
 Private Sub Invert(ByVal xstr As String, ystr As String)
   Dim tempstr As String
   i=Len(xstr)
   Do While i >=1
     tempstr=tempstr + Mid(xstr, i, 1)
     i=i - 1
   Loop
   ystr=tempstr
 End Sub
  A) fedcba    
  B) abcdef
  C) afbecd    
  D) defabc
最后更新时间:2008-05-28 12:13:58
文章评论
共有 0 位网友发表了评论
用户名: 新注册) 密码: 匿名评论 [查看所有评论]

评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
您可以用以下几种方式找到此文章

考试全流程