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

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

(27) 下列程序段的执行结果为
  a=1
  b=5
  Do
  a=a + b
  b=b + 1
  Loop While a < 10
  Print a; b
  A) 1 5    
  B) 12 7
  C) a b    
  D) 10 25
(28) 下列程序段的执行结果为
  a=75
  If a > 60 Then I=1
  If a > 70 Then I=2
  If a > 80 Then I=3
  If a < 90 Then I=4
  Print "I="; I
  A) I=1    
  B) I=2
  C) I=3    
  D) I=4
(29) 有如下事件过程:
Private Sub Command1_Click()
   b=10
   Do Until b=-1
     a=InputBox("请输入a的值")
     a=Val(A)
     b=InputBox("请输入b的值")
     b=Val(b)
     a=a * b
   Loop
   Print a
End Sub
程序运行后,依次输入数值30,20,10,-1,输出结果为
  A) 6000      
  B) -10
  C) 200      
  D) -6000
(30) 下面程序段执行结果为
x=Int(Rnd() + 3)
Select Case x
   Case 5
      Print "excellent"
    Case 4
      Print "good"
   Case 3
      Print "pass"
   Case Else
      Print "fail"
End Select
  A) excellent     
  B) good
  C) pass      
  D) fail
(31) 定义过程的格式中,Static关键字的作用是指定过程中的局部变量在内存中的存储方式。若使用了Static关键字,则
  A) 每次调用此过程,该过程中的局部变量都会被重新初始化
  B) 在本过程中使用到的,在其他过程中定义的变量也为Statci型
  C) 每次调用此过程时,该过程中的局部变量的值保持在上一次调用后的值
  D) 定义了该过程中定义的局部变量为"自动"变量
(32) 单击命令按钮时,下列程序的执行结果为
Private Sub Command1_Click()
   Dim x As Integer, y As Integer
   x=50: y=78
   Call PPP(x, y)
   Print x; y
End Sub
Public Sub PPP(ByVal n As Integer, ByVal m As Integer)
   n=n \ 10
   m=m \ 10
End Sub
  A) 08      
  B) 5078
  C) 450      
  D) 7850
(33) 单击按钮时,以下程序运行后的输出结果是
Private Sub proc1(x As Integer, y As Integer, z As Integer)
   x=3 * z
   y=2 * z
   z=x + y
End Sub
Private Sub Command1_Click()
   Dim x As Integer, y As Integer, z As Integer
   x=1: y=2: z=3
   Call proc1(x, x, z)
   Print x; x; z
   Call proc1(x, y, y)
   Print x; y; y
End Sub
   A) 6  6  12     
      6  10  10      
   B) 9  5  10               
      5  10  10
   C) 9  6  12     
      9  10  15     
   D) 9  10  10                
      5   4  10
 (34) 单击命令按钮时,下列程序的运行结果为
Private Sub Command1_Click()
   Print MyFund(20, 18)
End Sub
Public Function MyFund(m As Integer, n As Integer) As Integer
   Do While m <> n
      Do While m > n: m=m - n: Loop
      Do While m < n: n=n - m: Loop
   Loop
   MyFund=m
End Function
  A) 0       
  B) 2
  C) 4       
  D) 6
 (34) 单击命令按钮时,下列程序的运行结果为
Private Sub Command1_Click()
   Print MyFund(20, 18)
End Sub
Public Function MyFund(m As Integer, n As Integer) As Integer
   Do While m <> n
      Do While m > n: m=m - n: Loop
      Do While m < n: n=n - m: Loop
   Loop
   MyFund=m
End Function
  A) 0       
  B) 2
  C) 4       
  D) 6

最后更新时间:2008-05-28 12:13:58
文章评论
共有 0 位网友发表了评论
用户名: 新注册) 密码: 匿名评论 [查看所有评论]

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

考试全流程