[单项选择题] 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:Private Sub Command1_Click () Dim a As Integer, b As In

18 查阅

[单项选择题] 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程:

Private Sub Command1_Click ()

Dim a As Integer, b As Integer, c As Integer

a = 1: b = 2: c = 3

Print fun2 (c, b,

A.

End Sub

Private Function funl (x As Integer, y As Integer, z As Integer)

fun1 = 2 * x + y + 3 * z

End Function

Private Function fun2(x As Integer, y As Integer, z As Integer)

fun2 = fun1(z, x, y)+ x

End Function

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

B.14

C.17

D.30

参考答案:

B

[分析] 对于多个过程或函数依次调用的处理和简单过程调用处理一样,本题先调用函数 fun2,而函数fun2又调用函数fun1,结果返回的顺序是从fun1到fun2,fun2计算后输出到调用的地方。只要注意函数的调用关系依次处理即可解决此类问题。

计算机考试