2004年9月二级VB技术笔试试卷及答案

出处:考试大 作者:oyshaoli 日期:2007年07月18日 14时10分
        

   (21) 设一个工程由两个窗体组成,其名称分别为Form1和Form2,在Form1上有一个名称为Command1的命令按钮。窗体Form1的程序代码如下:

   Private Sub Command1_Click()

   Dim a As Integer

   a=10

   Call g(Form2,a)

   End Sub

   Private Sub g(f As Form,x As Integer)

   y=IIf(x>10,100,-100)

   f,Show

   f.Caption=y

   End Sub

   运行以上程序,正确的结果是

   A) Form1的Caption属性值为100

   B) Form2的Caption属性值为-100

   C) Form1的Caption属性值为-100

   D) Form2的Caption属性值为100

   (22) 在窗体上画一个名称为Command1的命令按钮,并编写如下程序:

   Private Sub Command1_Click()

   Dim x As Integer

   Static y As Integer

   x=10

   y=5

   Call f1(x,y)

   Print x,y

   End Sub

   Private Sub f1(ByRef x1 As Integer, y1 As Integer)

   x1=x1+2

   y1=y1+2

   End Sub

   程序运行后,单击命令按钮,在窗体上显示的内容是

   A) 10 5 B) 12 5 C) 10 7 D) 12 7

   (23) 设有如下程序

   Option Base 1

   Private Sub Command1_Click()

   Dim a(10) As Integer

   Dim n As Integer

   n=InputBox("输入数据")

   If n<10 Then

   Call GetArray(a,n)

   End If

   End Sub

   Private Sub GetArray(b() As Integer,n As Integer)

   Dim c(10) As Integer

   j=0

   For i=1 To n

   b(i)=CInt(Rnd()*100)

   If b(i)/2=b(i)\2 Then

   j=j+1

   c(j)=b(i)

   End If

   Next

   Print j

   End Sub        

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

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

考试全流程