niusouti.com

单击命令按钮时,下列程序的执行结果是 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+2 End Function Function SecProc (x As In

题目

单击命令按钮时,下列程序的执行结果是 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+2 End Function Function SecProc (x As Integer,y As hteger,z As Integer) SecProc=FirProc(z,x,y)+x+7 End Function

A.20

B.25

C.37

D.32


相似考题
更多“单击命令按钮时,下列程序的执行结果是 Private Sub Command1_Click() Dim a As Integer,b As ”相关问题
  • 第1题:

    单击命令按钮时,下列程序的执行结果是

    Private Sub Command1_Click()

    BT 4

    End Sub

    Private Sub BT(x As Integer)

    x=x*2 + 1

    If x < 6 Then

    Call BT(x)

    End If

    x=x  2

    Print x;

    End Sub

    A.15

    B.16

    C.17

    D.18


    正确答案:D
    解析:此题在函数调用过程中采用了简单递归的方式,具体流程如下:主调过程调用BT过程,把实参4传递给BT过程中的形参x,由x=x2+1语句推出x=9,此时不满足BT过程中判断语句的判断条件,执行x=x2;Print x;语句。由x=x2语句得到x值为18并输出,结束此次调用过程,返回到主调过程结束程序,输出结果为18。

  • 第2题:

    若看到程序中确以下事件过程,则可以肯定的是,当程序运行时( )。

    Private Sub Click—MouseDown(Button As Integer,Shift As Integer,X As Single,Y

    As Single)

    Print"VB Program"

    End Sub

    A.用鼠标左键单击名称为“Command1”的命令按钮时,执行此过程

    B.用鼠标左键单击名称为“MouseDown”的命令按钮时,执行此过程

    C.用鼠标右键单击名称为“MouseDown”的命令按钮时,执行此过程

    D.用鼠标左键或右键单击名称为“Click”的命令按钮时,执行此过程


    正确答案:D
    D。【解析】事件过程的命名方式一般为事件对象_事件名,所以该事件应为“Click”的“MouseDown”事件。

  • 第3题:

    单击命令按钮时,下列程序的执行结果是 Private Sub Commandl_Click( ) BT 4 End Sub PriVate Sub BT(x As Integer) X=X * 2 + 1 If x <6 Then Call BT(x) End If X=x * 2 Print x; End Sub

    A.15

    B.16

    C.17

    D.18


    正确答案:D
    解析:此题在函数调用过程中采用了简单递归的方式,具体流程如下:主调过程调用BT过程,把实参4传递给BT过程中的形参x,由x=x*2+1语句推出x=9,此时不满足BT过程体中判断语句的判断条件,执行x=x*2;Printx;语句。由x=x*2语句得到x值为18并输出,结束此次调用过程,返回到主调过程结束程序,输出结果为18。

  • 第4题:

    若看到程序中确以下事件过程,则可以肯定的是,当程序运行时( )。 Private Sub Click—MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) Print"VB Program" End Sub

    A.用鼠标左键单击名称为“Command1”的命令按钮时,执行此过程

    B.用鼠标左键单击名称为“MouseDown”的命令按钮时,执行此过程

    C.用鼠标右键单击名称为“MouseDown”的命令按钮时,执行此过程

    D.用鼠标左键或右键单击名称为“Click”的命令按钮时,执行此过程


    正确答案:D
    D。【解析】事件过程的命名方式一般为事件对象_事件名,所以该事件应为“Click”的“MouseDown”事件。

  • 第5题:

    单击命令按钮时,下列程序的执行结果是 Private Sub Book(x As Integer) x=x * 2 + l If x<6 Then Call Book(x) End If X=X * 2 + 1 Print x; End Sub Private Sub Command2_Click() Book2 End Sub

    A.23 47

    B.10 36

    C.22 44

    D.24 50


    正确答案:A
    解析:此题在函数调用过程中采用了简单递归的方式,具体流程如下:主调过程调用Book过程,把实参2传递给Book过程中的形参x,由x=x*2+1语句推出x=5,此时满足Book过程体中判断语句的判断条件,执行CallBook(x)语句,第二次调用Book过程。由x=x*2+1语句得到x值为11,判断条件1l6为假,故返回此调用过程执行x=x*2+1语句,的x=23并输出,结束此次调用过程。由于两次调用Book过程,第二次仍返回调用时的断点语句,即执行x=x*2+1,Printx,输出x的值为47,返回到主调过程,结束程序,两次输出为2347,正确答案为选项A。

  • 第6题:

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

    程序运行后,单击命令按钮,输出的结果是_________。


    正确答案:
    4
    【解析】本题考查了数组的嵌套使用。程序首先通过一个For循环给数组M的各个数组元素赋值,然后通过数组下标嵌套本身。注意:这样的嵌套时,要保证数组下标不出界,否则程序将出错。